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
In reply to Re: This regex seems to have splattered non-greedy everywhere
by pbeckingham
in thread This regex seems to have splattered non-greedy everywhere
by fizbin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |