Last modified: 2013-09-04 15:44:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T55727, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53727 - Replace all (or at least most) uses of \b with (?:^|$|\s) or variants
Replace all (or at least most) uses of \b with (?:^|$|\s) or variants
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: High normal
: ---
Assigned To: Gabriel Wicke
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-03 23:07 UTC by Gabriel Wicke
Modified: 2013-09-04 15:44 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gabriel Wicke 2013-09-03 23:07:41 UTC
We use \b often to match (?:^|$|\s), but it does in fact match "A word boundary matches the position where a word character is not followed or preceeded by another word-character.", where \w is equivalent to [A-Za-z0-9_] [1].

Example:
/\bfoo\b/.test('aaa:foo:bbb');
true

We should go through and fix all improper uses of \b.

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#special-word-boundary
Comment 1 Gerrit Notification Bot 2013-09-04 01:07:03 UTC
Change 82562 had a related patch set uploaded by GWicke:
Bug 53727: Don't use \b to match (^|$|\s)

https://gerrit.wikimedia.org/r/82562
Comment 2 Gerrit Notification Bot 2013-09-04 15:44:57 UTC
Change 82562 merged by jenkins-bot:
Bug 53727: Don't use \b to match (^|$|\s)

https://gerrit.wikimedia.org/r/82562

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


Navigation
Links