This expression means: From the beginning of the string ( ^), zero or more spaces or tabs ( \011 is the octal ASCII number for a tab character), zero or one sign, one or more digit, zero or more spaces/ tabs, and finally match the end of string. result=STRMATCH(string, '^.+$') This interesting example matches any integer number, possibly surrounded by spaces and/or tabs. result=STRMATCH(string, '^.$') Matches strings three characters or longer. result=STRMATCH(string, '^ *$') Matches only three-character strings. result=STRMATCH(string, '^$') Matches either blank or null strings (Between the beginning ( ^) and the end ( $) there are only zero or more spaces ( *)). result=STRMATCH(string, '.') Matches only empty strings (start and end with nothing in between). result=STRMATCH(string, '\\.') Matches any string containing any character (that is, any non-null string). Remember that it takes two backslashes in a PV-WAVE string to produce the single back slash that “escapes” the dot (. ' 3.14159' matches ' the quick brown fox' does not match. A quick reference for regular expressions (regex), including symbols, ranges, grouping. I have browsed the web and found out that string can be escaped with \Q some string \E. The problem occurs when this needle string contains special regex characters like ,+ and so on. result=STRMATCH(string, 'Ll+') result=STRMATCH(string, '^.*x$') Matches any string containing a period. 17 I want to do a string search inside a string. result=STRMATCH(string, '^at') Matches any string containing ' L' followed by one or more occur rences of ' l': ' Get a Llama' matches ' larry the llama' does not match (first l in llama is lower case). result=STRMATCH(string, 'a') Matches any string beginning ( ^) with Cat, bat, and so on: ' Cat Woman', ' catatonic', ' Batman, the animated series' but does not match: ' cat' (begins with a space), ' cab', and so on. Matches any string containing the character ' a'. The following PV‑WAVE commands demonstrate the regular expression pattern matching used in the STRMATCH command. Assume that string is a string array defined in PV‑WAVE.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |