Mathematica > String Operations >

StringMatchQ

StringMatchQ["string", patt]
tests whether "string" matches the string pattern patt.
StringMatchQ["string", RegularExpression["regex"]]
tests whether "string" matches the specified regular expression.
StringMatchQ[{s1, s2, ...}, p]
gives the list of results for each of the si.
  • StringMatchQ allows both ordinary StringExpression string patterns, as well as abbreviated string patterns containing the following metacharacters:
*zero or more characters
@one or more characters, excluding upper-case letters
\\*, etc.literal *, etc.
  • Verbatim["p"] specifies the verbatim string "p", with * and @ treated literally.
New in 1 | Last modified in 5.1
© 2008 Wolfram Research, Inc. japanese.gif
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team