I know that Mathematica can perform string comparison using either StringExpression or RegularExpression. Although regular expressions are more common, I feel that the Mathematica StringExpressions are more intuitive. So is it possible to ask Mathematica to convert from one to the other?
For example, this regular expression was found from another thread
RegularExpression["\\\\newcommand({([^{}]|(?1))*})(?1)"]
Could it be converted into a StringExpression automatically?
StringPattern`PatternConvertreturns the regular expression corresponding to aStringExpression. See Working with String Patterns. I seem to recall mention on this site of an equally obscure function capable of doing the opposite conversion, but I can't find it any more. – MarcoB Feb 27 '16 at 04:55StringPattern`PatternConvertand I cannot think of a good reason for one to exist in the system, sinceStringExpressionis converted into a regular expression, not the other way around. Nevertheless I will be pleased if I am proven wrong. – Mr.Wizard Feb 27 '16 at 09:48PatternConvert, I have come to the conclusion that my original recollection must be wrong, and in fact there had been no mention of such a function. As you said, this stands to reason anyway, since the system converts from string expressions to regex. – MarcoB Feb 29 '16 at 04:23