m/.../The match operator m/regex/ tests whether a string contains a substring matching the regex. For simple matches of this sort in Mathematica, use StringFreeQ. Here is a Perl snippet for testing whether a string contains a "b" somewhere after an "a". Here is a Mathematica version of the same test. In[93]:=  |
 If parts of the matched string need to be accessed later, using $1, $2, ... in Perl, the best Mathematica function to use is normally StringCases. Here is Perl code for extracting an error message. Here is a Mathematica version. In[95]:=  |
 Here is Perl code for extracting several subpatterns at once. In Mathematica, this is done with StringCases. In[97]:=  |
Out[98]=
|
This is similar to assigning all the matches to an array using the /g modifier. The same thing is easily done with StringCases in Mathematica. In[99]:=  |
Out[100]=
|
|