Determines if the entire string matches the given pattern.
IsMatch = SRP_Regex("Match", String, Pattern)
Returns
1 if the string matches the given pattern, 0 if not.
Parameters
Parameter | Description |
---|---|
String | The target string to be pattern matched. (REQUIRED) |
Pattern | The regex pattern. (REQUIRED) |
Remarks
The Match service determines if the given string matches the provided regex pattern. The whole string has to match the pattern to result in a 1. If you're interested in substrings, then you should look into the Search service.
Examples
Pattern = '[Gg]o+gle' Ans = SRP_Regex('Match', 'ggle', Pattern) ; // False Ans = SRP_Regex('Match', 'Gogle', Pattern) ; // True Ans = SRP_Regex('Match', 'google', Pattern) ; // True Ans = SRP_Regex('Match', 'Goooogle', Pattern) ; // True Ans = SRP_Regex('Match', 'gooooooogle', Pattern) ; // True Ans = SRP_Regex('Match', 'Google Search', Pattern) ; // False