in reply to Regular Expression Pieces
UPDATE: Haven't you people read Death to Dot Star!? ;) Seriously, while a non-greedy dot star works does work for this example, i cannot recommend using it when there is a better solution: a negated character class ([^\]]+).my $a = "this is a test [[1]] [[ a ]] [[ abd ]] [[\%object,key]]"; print $_,$/ for $a =~ /(\[\[[^\]]+\]\])/g; __DATA__ [[1]] [[ a ]] [[ abd ]] [[%object,key]]
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (jeffa) Re: Regular Expression Pieces
by Gilimanjaro (Hermit) on May 08, 2003 at 10:20 UTC |