Open Bug 1851421 Opened 2 years ago Updated 2 days ago

Use /a modifier on regexps that contain \d to avoid unintentional unicode matches

Categories

(Bugzilla :: Bugzilla-General, enhancement)

enhancement

Tracking

()

People

(Reporter: justdave, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

Attachments

(1 file)

This is complicated. Bug Perl 5.14 (which we now require) makes this possible.

All of the good details are on bug 1136137 and you can examine the patch there for what types of things need to be done. I count 213 regexps that use \d from a quick grep. They might not all need to be touched because in many cases we can use re '/a' or similar to cover a bunch of them.

The docs for the modifiers appear to have moved since that bug though. You can now see them here

This is more likely to go in 5.2.2 than 5.2.1 because of timing but I don't have a tracking bug for that one yet.

Looks like /a also changes \w, \s, and word-boundary semantics, so we should use inline (?a:...) for regex pattern strings that also use those.

This needs to land on harmony as well.

Depends on: 2052697
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: