-
Notifications
You must be signed in to change notification settings - Fork 12
String.Search
boxgaming edited this page Aug 5, 2025
·
3 revisions
Executes a search for a match between a regular expression and this string, returning the index of the first match in the string, or 0 if no match was found.
result = String.Search (s$, regex$)
- The s$ parameter contains the string to search.
- The regex$ parameter contains the regular expression used to search within s$.
Import String From "lib/lang/string.bas"
Dim s As String
s = "The quick brown fox jumped over the lazy dog."
Print String.Search(s, "[^\w\s']"); 'Anything not a word character, whitespace or apostrophe
Print " "; Mid$(s, String.Search(s, "[^\w\s']")) 45 .