On Tue, Sep 18, 2007 at 07:22:22AM -0400, G. T. Stresen-Reuter wrote: > I'm looking for a regex pattern that will find quoted strings (double > quotes) but skip (double-)quoted strings containing any of the > following characters: $'"\ (dollar sign, single quote, double quote, > backslash) > > At first I tried "[^\$'"\\]+?" but it was matching the end of one > quoted string and the beginning of the next...
In order to match the quoted strings you want, you'll also have to match the quoted strings you don't want. That's the only way to keep track of which quotes are opening a string and which are closing a string. And if you're matching quoted strings in a computer program, it may be even more complicated than that. How should this be handled? $str = "Here's a string."; # this comment has a " in it! $str2 = "Here's another string."; So the question is: What do you want to do with these quoted strings once you've found them? Ronald -- ------------------------------------------------------------------ Have a feature request? Not sure the software's working correctly? If so, please send mail to <[EMAIL PROTECTED]>, not to the list. List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml> List archives: <http://www.listsearch.com/BBEditTalk.lasso> To unsubscribe, send mail to: <[EMAIL PROTECTED]>
