You can match specific numbers exactly, for example, 100, 1506, 867-5309 ('literal matching') or you can match against a template (for example, 'match any 5-digit number joined by a hyphen to a 4-digit number').
Syntax
This syntax is mandatory when specifying a character template or number template. It matches the contained template on a per character basis.
Separate multiple templates with commas:
%#<template>%,%#<template>%
This syntax is not needed for literal matching.
Matches any single letter
Matches any single digit (0-9)
Matches any single letter or digit
Matches any single punctuation character
Matches a character M times. For example, \d[3] matches any 3 digit number.
Matches a character from M to N times. For example, \d[1,5] matches any number with between 1 and 5 digits
Matches any character between 'a' and 'z'. Use this syntax to limit the range of permitted character matches.
Examples
Captures 867-5309 only; it does not capture, for example, 5309, or 467-5309.
Captures any string of 5 digits followed by 3 letters, followed by a hyphen and 5 to 7 digits. For example, 32456dfs-345661.
Captures 7 digit telephone numbers where the first three digits are separated by a period, a dash, or a space. For example, 021-7657 or 021 7657.
Captures any numeric string that starts with 2, 3, 4, or 5, and is followed by 11 to 13 digits. For example, 398744614630.
Captures the number 22, followed by exactly two letters, then 1 to 4 digits, joined to punctuation, then followed by a space and the letter x, y, or z. For example, 22AB123. Z.
| Copyright © 2011 CA. All rights reserved. | Email CA Technologies about this topic |