Last modified: 2014-04-08 08:59:08 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 T50614, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48614 - Search and replace not working for regexes with lookahead
Search and replace not working for regexes with lookahead
Status: UNCONFIRMED
Product: MediaWiki extensions
Classification: Unclassified
WikiEditor (Other open bugs)
master
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 63665
  Show dependency treegraph
 
Reported: 2013-05-19 11:01 UTC by Liam Riley
Modified: 2014-04-08 08:59 UTC (History)
5 users (show)

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


Attachments

Description Liam Riley 2013-05-19 11:01:44 UTC
I have recently started using the regex feature in the Edit Toolbar's Search and Replace.

I have been unable to get a regex using a lookahead to successfully replace the text. As an example, here - http://en.wikipedia.org/w/index.php?title=User:Sillyfolkboy/Resources/Ath_Sandbox_1&action=edit

Using "\d   (?=\w)" successfully finds all the lines starting with a digit and three spaces (followed by a letter). When I click "replace all" I'm told that 123 replacements have been made, but no text is replaced. Clicking find next, then replace all tells me that 123 replacements have been made again. The replace function seems to fail when a lookaround is included in the search.

This may be just a learning issue for myself given the lack of documentation (see https://bugzilla.wikimedia.org/show_bug.cgi?id=23626) but what I'm doing works on http://www.regextester.com/ which ostensibly should be doing the same thing as Wikipedia's search and replace.
Comment 1 Platonides 2013-05-19 11:14:43 UTC
What browser are you using? Not all browsers support the same features, so it could be UA-specific.


The problem seems to be with the replace, as find works.
Comment 2 Platonides 2013-05-19 11:18:48 UTC
It doesn't seem to be a problem of the browser replace, this works:
 "10   W".replace(/\d+   (?=\w)/, "Foo ");
Comment 3 Liam Riley 2013-05-19 18:02:26 UTC
I'm using firefox 21 - just upgraded and the problem persists from version 20. I've downloaded the latest Google Chrome (26) and that produces the same issue.
Comment 4 Liam Riley 2013-05-19 18:59:35 UTC
Downloaded and tried on IE9 and the search and replace button in the toolbar isn't even working!
Comment 5 XP1 2013-05-20 08:15:16 UTC
(In reply to comment #4)
> Downloaded and tried on IE9 and the search and replace button in the toolbar
> isn't even working!

See:

Bug 48305 - 1.22wmf3, "Search and replace" capability not working in IE/Opera:
https://bugzilla.wikimedia.org/show_bug.cgi?id=48305#c9

Bug 23992 - Search&replace disabled in IE8, Opera:
https://bugzilla.wikimedia.org/show_bug.cgi?id=23992

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


Navigation
Links