Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

PosNameDescription
<x, 1>
StringThe actual substring matching the pattern.
<x, 2>
PosThe starting position of the match within the original string.
<x, 3>
LengthThe length of the match.
<x, 4>
CapturesAn @SVM delimited list of captured groups. (You can learn more about capturing groups here.)

If you don't care about all this information and just want the matched strings, use the ExtractAll service instead.

Examples

Code Block
languagebp
// find both phone numbers
String  = 'Call 800-555-1212 for info, or fax us at 888-555-3535'
Pattern = '((\d{3})(?:\.|-))?(\d{3})(?:\.|-)(\d{4})'
Result  = SRP_Regex("SearchAll", String, Pattern)

// the phone number info
PhoneNumber   = Result<1, 1>
PhoneAreaCode = Result<1, 4, 2>

// the fax info
FaxNumber   = Result<2, 1>
FaxAreaCode = Result<2, 4, 2>

...