It's really, really long code that I'm inheriting, so it's difficult to post a small self-contained portion, but those regexs I posted should cause the problem on their own when run against certain lines of Japanese.
One step in the diagnosis is to determine whether it really is the regexes themselves (and their handling of Japanese), or whether it is instead some other problem involving the Japanese data in the big app, regardless of the regexes (e.g. only the Japanese data are coming from a particular source that isn't playing nice with the app).
You have a local machine and a remote machine; you have a small sample of Japanese text and non-Japanese text; you have a set of regexes. If a single minimal test script, containing its own test data and applying those regexes, runs in roughly the same amount of time in both the local and remote machines (or at least, behaves consistently when applying the regexes to the Japanese and non-Japanese strings), then the problem in the big app is probably not being caused by the regexes.
Here is what it boils down to: What sort of evidence did you have that led to your conclusion in the OP that the regexes were causing the problem? And what is the likelihood that your original evidence might also be due to some other cause, not involving the regexes?
If you try the test script that JavaFan supplied above, and it turns out to show a really big slow-down on the remote machine, then you really do have a problem using those regexes with Japanese text on that machine. That would be strange, but in that case, you can try some different variations on the regexes to see if there's another way to do the job without taking the hit.
OTOH, in the more likely case that the regexes are performing as expected in that test, you'll need to examine what else is going on with the Japanese data in the big app on the remote machine (and how it differs from the local one)...
In reply to Re^3: Weird Perl 5.8.8 Regex Problems for Japanese UTF8
by graff
in thread Weird Perl 5.8.8 Regex Problems for Japanese UTF8
by ruski86
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |