A question about string patterns

*To*: mathgroup at smc.vnet.net*Subject*: [mg111434] A question about string patterns*From*: fd <fdimer at gmail.com>*Date*: Sun, 1 Aug 2010 04:57:10 -0400 (EDT)

Dear Group I'm kind of starting with string patterns with Mathematica and would like to make sense of some questions. I was sorting out a string matching problem in Vim where I needed to find all strings not enclosed by double quotes (\"). To do this a regular expression with look-behind seems to be essential. The tutorial in advanced string patterns from WR says Mathematica pattern lacks look-ahea/look behind type of functions, anyway, I tried with Mathematica and found that it was really easy, the solution (I suppose) I found in mathematica is text = "this is a text with \"quotes\" we wish to select and there \ are more than \"one\" whole \"set \" of them \"the end\"" StringReplace[text, (x : Except["\""] ...) ~~ (y : ("\"" ~~ Except["\""] ... ~~ "\"") ...) :> ToUpperCase[x] ~~ y] So my questions are: 1) is there some type of problem that can only be solved with look- ahead/look-behind, so that RegularExpression[] or some piece of Mathematica code had to be used? 2) It seems to me that look behind/ahead constructs can be somehow emulated with named patterns in Mathematica, is this always the case? Finally, I'd be really glad to know of anyone else's solution to this problem (either mathematica or regexp). Any other comment/thoughts on this problem would be greatly appreciated. Best Felipe