Wolfram Language & System 10.3 (2015)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)


gives a list of the substrings in that match the string expression patt.

gives a list of the values of rhs corresponding to the substrings that match the string expression lhs.

includes only the first n substrings that match.

gives substrings that match any of the .

gives the list of results for each of the .

represents an operator form of StringCases that can be applied to an expression.

Details and OptionsDetails and Options

  • String expressions can contain any of the objects specified in the notes for StringExpression.
  • With the default option setting Overlaps->False, StringCases includes only substrings that do not overlap. With Overlaps->True, it includes substrings that overlap.
  • With Overlaps->All, multiple substrings that match the same string expression are all included. With Overlaps->True, only the first such matching substring at a given position is included.
  • Setting the option IgnoreCase->True makes StringCases treat lowercase and uppercase letters as equivalent.
  • StringCases["string",RegularExpression["regex"]] gives substrings matching the specified regular expression.
  • StringCases[s,lhs:>rhs] evaluates rhs only when the pattern is found.
Introduced in 2004