Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: This regex seems to have splattered non-greedy everywhere

by pbeckingham (Parson)
on Aug 10, 2005 at 17:45 UTC ( #482674=note: print w/ replies, xml ) Need Help??


in reply to This regex seems to have splattered non-greedy everywhere

It can be easily made to work if you first take out the quoted stuff. Bear in mind that this (and your) code does not handle quoted text that spans lines.

#! /usr/bin/perl use strict; use warnings; while (<DATA>) { chomp; s/'[^']+'//g; print $_, "\n" for split /XX/; } __END__ aXXbXXc abcd a little 'quote XX' quote stuff XX other



pbeckingham - typist, perishable vertebrate.


Comment on Re: This regex seems to have splattered non-greedy everywhere
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://482674]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-07-08 07:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (96 votes), past polls