in reply to regex: how to negate a set of character ranges?
intsead of:[\x30-\x39\x41-\x59\x61-\x7A]
This would allow you to have one huge character class instead of multiple. I don't have any source text with exotic chacters, so this is not tested. But, I see other problems. You have a missing second slash in the substitution regex. Another issue is that you have tried to use nesting within character classes, which doesn't work.. So, assuming that you've done the above and combined the classes, in the fix I'm also removing the outer square brackets. Instead of:[\x30-\x39] | [\x41-\x59] | [\x61-\x7A]
Try:s/[${shiftjis}]/ogx;
If that doesn't help, please post a short section of your source material to help test other solutions.s/${shiftjis}//ogx;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex: how to negate a set of character ranges?
by kettle (Beadle) on Apr 29, 2007 at 17:49 UTC | |
by dynamo (Chaplain) on May 02, 2007 at 04:07 UTC |