Simple AbstractMatcher that uses a pattern to match rows.
A string pattern is compared directly against provided rows. By default the pattern is compared against the bells at the back of the change, e.g.:
const pat = new Pattern('5678');pat.match('43125678'); // true (matches)pat.match('43126578'); // false (doesn't match)pat.isWildcardMatch; // truepat.matchCount; // 1pat.print('text'); // '1 5678' Copy
const pat = new Pattern('5678');pat.match('43125678'); // true (matches)pat.match('43126578'); // false (doesn't match)pat.isWildcardMatch; // truepat.matchCount; // 1pat.print('text'); // '1 5678'
It's also possible to check the bells at the front of the change:
const pat = new Pattern('8765', '8765 off the front', MatchType.Front);pat.match('87654321'); // truepat.isWildcardMatch; // truepat.print('text'); // '1 8765 off the front' Copy
const pat = new Pattern('8765', '8765 off the front', MatchType.Front);pat.match('87654321'); // truepat.isWildcardMatch; // truepat.print('text'); // '1 8765 off the front'
... or check an entire row:
const pat = new Pattern('13572468', 'Queens', MatchType.Row);pat.match('13572468'); // truepat.isWildcardMatch; // falsepat.print('text'); // 'Queens' Copy
const pat = new Pattern('13572468', 'Queens', MatchType.Row);pat.match('13572468'); // truepat.isWildcardMatch; // falsepat.print('text'); // 'Queens'
If no pattern name is provided then the pattern itself will be used when printing results.
Constructor.
String to match.
Optional
Name to use when printing results.
Type of match.
Protected
Count of matches.
Whether this is a wildcard match.
Provides read access to the count of matches.
Provides read access to the name.
Matches a row string.
Simple AbstractMatcher that uses a pattern to match rows.
A string pattern is compared directly against provided rows. By default the pattern is compared against the bells at the back of the change, e.g.:
It's also possible to check the bells at the front of the change:
... or check an entire row:
If no pattern name is provided then the pattern itself will be used when printing results.