Home

News

International

Screen Shots

Documentation

Download

Build

License

Credits

Contact

SourceForge Project

Tintware Documentation : Tint Programming Language : Tint Reference : Strings : string.regex-match

Syntax

#(%string.regex-match,%regex)
#(%string.regex-match,%regex,%notfound)
#(%string.regex-match,%regex,[%notfound],%result)

%string is any string. %regex is the name of a regular expression object used to match against the string. %notfound is what should be returned if a regular expression match is not found in the string. %result is where information about a successful match should be placed.

Starting from the offset, the string is matched against %regex. If a match is found, all of the characters from the offset to just before the beginning of the match are returned, and the offset is set to just after the match. If %result is specified, then %result.strings will contain the captured strings and %result.offsets will contain their offsets. If no match is found, and %notfound was specified, then it will be returned active.

Example

#(regex,a-regex,abc*)

#(def,a-string,zabyyabcccxxx)

#(a-string.regex-match,a-regex)
z
#(a-string.regex-match,a-regex)
yy
#(a-string)
xxx
#(a-string.regex-match,a-regex,not found)
not found