On 6/28/05, Shilpa Arvind <[EMAIL PROTECTED]> wrote: > Hi, > > I am having trouble understanding this regular expression. Any help on this > is greatly appreciated. > > open FILE, "xyz"; > while (<FILE>) > { > undef($regexp_var); > ($regexp_var) = ($_ =~ > /(\"(\\\"|[^\"])+\")/); > s/(\"(\\\"|[^\"])+\")// if (defined > $regexp_var); > } > What does \" do. (Quotes) " does not require blackslash but here it is used > with blackslash. What does this do. > > Shilpa > > >
Can you give us a little more context? Where did you get this from? what it the script it's part of supposed to do? The thing that jumps immediately to mind are 1) it was originally a one-liner, and these are shell escapes, 2) it's a deliberate obfuscation from perlmonks or someplace similar, 3) the original delimiter was something else, and these are all literal backslashes, or 4) the person who did this wasn't a very good coder, or was used to using sed. Actually 4 is obviously true, unless this is a deliberate obfuscation: why perform the match and then the substition if the match is successful? Just using s/// would have been more than adequate: it can't substitute if it doesn't match. Right now, it just looks like a really awkward way to delete a windows path. Where *did* you dig this up? -- jay -------------------- daggerquill [at] gmail [dot] com http://www.tuaw.com http://www.dpguru.com http://www.engatiki.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>