in reply to Re: Need a cool RegExpresseion. plz help
in thread Need a cool RegExpresseion. plz help
Two nits. You can write your character classes as [^]] rather than [^\]]. I think it's easier to read that way but someone else might not. More importantly, your /m modifier to the regex isn't doing a bit of good. That only affects the way anchors (^ and $) work. Perhaps you meant to use /s so that your final .* would match a newline.
Other than that, your reply is better than mine as it actually does what he asked for rather than matching the "winning" group, which is what I did...
Update: Just to be clear, I'd write it like s/\[[^]]*?#[^]]*?#[^]]*?\]//g. I prefer to be explicit about matching anything other than a right bracket rather than using constructs like .*?\] which work but don't really say what they mean. Avoiding them also allows you to avoid the /s modifier.
-sauoq "My two cents aren't worth a dime.";
|
|---|