|
Prev: comp.lang.perl.misc charter
Next: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.8 $)
From: Abigail on 22 Apr 2008 10:32 _ bugbear (bugbear(a)trim_papermule.co.uk_trim) wrote on VCCCXLVIII September MCMXCIII in <URL:news:q_idndGAufFacZDVnZ2dnUVZ8tGqnZ2d(a)plusnet>: `' TonyV wrote: `' > `' > I'm not lazy, I've been plugging away at this trying to work with look- `' > behind reference, greedy matching, and so on, but I'm just at an `' > impasse and can't extract what I want out of it. I've googled various `' > regex cookbooks (even have access to O'Reilly's Safari), but I've come `' > up with bupkiss. `' `' IIRC it is *impossible* to fully implement nested matching quotes `' with a regexp. This was already possible in 5.6, and it even simpler in 5.10. For instance, qr [((?:\((?1)*\))*)] is a regexp to match balanced nested parens. But the OP isn't asking about nested matching quotes. All he wants is delimited strings, with escapes. I'd use Regexp::Common, but it's not hard to come up with a regexp for a single quote delimited string (untested): /'[^\\']*(?:\\.[^\\']*)*'/s Abigail -- A perl rose: perl -e '@}-`-,-`-%-'
First
|
Prev
|
Pages: 1 2 Prev: comp.lang.perl.misc charter Next: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.8 $) |