[#BloombergLP-ball-PatternUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::PatternUtil
:relfileprefix: ../../
:mrdocs:

This utility class provides functions relating to pattern matching for strings&period;

== Synopsis

Declared in `&lt;ball&lowbar;patternutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct PatternUtil;
----

== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/PatternUtil/isMatch.adoc[`isMatch`] 
| Return `true` if the specified `pattern` matches the specified `inputString`, and `false` if the pattern does not match or is invalid&period; There are two types of escape sequences that are allowed in `pattern`&period; (See the function&hyphen;level documentation of `PatternUtil&colon;&colon;isValidPattern` for the definition of invalid patterns&period;) A &apos;&ast;` escape sequence in `pattern&apos; matches a single `&ast;` in `inputString`&period; A &apos;&apos; escape sequence in `pattern` matches a single &apos;&apos; in `inputString`&period; If `pattern` ends with an unescaped `&ast;`, then `pattern` matches `inputString` if the string indicated by `pattern` (after escape sequence processing) with the final `&ast;` removed is a prefix of `inputString`&period; Otherwise `pattern` matches `inputString` only if the string indicated by `pattern` (after escape sequence processing) and `inputString` are the same&period; The behavior is undefined unless both `inputString` and `pattern` are null&hyphen;terminated c&hyphen;style strings&period;
| xref:BloombergLP/ball/PatternUtil/isValidPattern.adoc[`isValidPattern`] 
| Return `true` if the specified `pattern` does not contain a &apos;&apos; not followed by either &apos;&apos; or `&ast;`, or an unescaped `&ast;` at locations other than at the end, and `false` otherwise&period; Note that an unescaped `&ast;` not at the end may someday be considered a valid pattern&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
