|
text://regex...
Usage:
text://regextest(<text>);<regexp>
text://regexindex(<text>);<regexp>
text://regexcount(<text>);<regexp>
text://regexcapture(<text>);<regexp>;<index>
Where <text> is a some text to be searched,
<regexp>
is a Regular Expression pattern
Examples and explanations:
-
text://regextest(<text>);<regexp>
returns True or False depending on whether the <regexp>
pattern is found in <text>
-
text://regexindex(<text>);<regexp>
returns a number that indicates the character position in
<text> of the first occurrence of <regexp> in <text>
-
text://regexcount(<text>);<regexp>
returns a number indicating the number of successful matches
of <regexp> in <text>
-
text://regexcapture(<text>);<regexp>;<index>
returns the text that matches the <regexp> in <text> where
<index> is the index number of the successful match of
<regexp> in <text>
Example:
text://regexpcapture(This is his chance to
advise);[^ ]is;2
returns ‘his’ and not the ‘ is’ after ‘This’.
Here are some simple
explanations of regular expression patterns:
· .
is any character
· +
is the character before the + one or more times; .+ will find any
character at least once
· *
is the character before the * zero or more times
· ?
is the character before the ? zero or one time
· [abcm-p]
is any character in the list or between ‘m’ and ‘p’
· [^abcm-p]
is any character except those in the list
Visit these links for
detailed used of Regular Expressions:
#
Regular Expressions @
msdn.microsoft.com
Table of Metacharacters
@ msdn.microsoft.com
|