Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How do I have my project appropriately perform Windows Explorer style pattern matching? ( This is all I have for now, and it isn't proving to be very fruitful. )
- ```
- function postive_id(pattern as string, subject as string ) as string
- dim as string match = string$( 0, 0 ), test = string$( 0, 0 )
- dim as integer pattern_offset = 0, match_offset = 0, test_offset = 0
- do while len( test_offset ) > 0
- test_offset += 1
- pattern_offset += 1
- flag = mid$( pattern, pattern_offset, 1 )
- select case flag
- case "?"
- test += mid$( subject, offset, 1 )
- pattern = mid$( pattern, 2 )
- case "*"
- match
- if left$( test, 1 ) = left$( match, 1 ) then
- end if
- test += mid$( subject, offset, 1 )
- if test =
- pattern = mid$( pattern, 2 )
- pattern_offset += 1
- end select
- loop
- end function
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement