Page MenuHomePhabricator

Search & Replace : Regular expressions with * does not work
Closed, InvalidPublic

Description

Author: wikibugs

Description:
Reporting against Babaco Release. (Hosted on http://prototype.wikimedia.org)

Steps to Reproduce ::

  1. Start creating a new page
  2. Add some text in the edit window
  3. Click 'Search and replace' icon (e.g : Testing MediaWiki )
  4. Set search for (Test* ) and Replace with (TESTING)
  5. Check flag 'Treat search string as a regular expression'
  6. Click 'Replace' button

<<Testing is replaced with TESTINGing >>

Expected Outcome ::

  • in Search string is ignored
  • Also other regular expressions are ignored (^ , $ etc)

Test Environment (Client) ::
Browser (User-Agent): Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
Javascript: Enabled
Cookies Enabled: Enabled
Java Enabled: Enabled
CPU class/type: OS/CPU Windows NT 6.0
Screen Width x Height: 1280 x 800
Screen Color Depth: 32


Version: unspecified
Severity: major
OS: Windows Vista
Platform: PC
URL: http://usability.wikimedia.org/wiki/Releases/Babaco/Compatibility_Matrix

Details

Reference
bz20597

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:47 PM
bzimport set Reference to bz20597.

WORKSFORME?

The regular expression /Test*/ will match "Tes" with any possible number of t's on the end. This could be "Tes" or potentially "Testtttttt". In any case, when using the string "Testing Mediawiki" and I replace /Test*/ with "TESTING" I get "TESTINGing Mediawiki" as I'd expect.

As mentioned in comment #1, test* only matching test and not testing is perfectly valid behavior. You seem to want test[^ ]* (test followed by any number of characters that aren't spaces).

wikibugs wrote:

Added keyword babaco to the bug