Page MenuHomePhabricator

mw.ustring does not match %W correctly
Closed, ResolvedPublic

Description

From https://en.wikipedia.org/wiki/Module_talk:String#str.match_.26_str.replace_bug:

In Lua

string.match("abc,def", "^%w*(%W*)%w*$") returns ,

but Module:String's implementation

{{#invoke:String|match|s=abc,def|pattern=^%w*(%W*)%w*$|plain=false}} returns ,def

which is clearly wrong. — {{carismagic|5 February 2014, 08:58}}

Confirmed that this is a bug in Scribunto. Patch to follow momentarily.


Version: master
Severity: normal

Details

Reference
bz60908

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:58 AM
bzimport added a project: Scribunto.
bzimport set Reference to bz60908.

Change 111467 had a related patch set uploaded by Anomie:
Fix PHP implementation of mw.ustring %W

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

Change 111467 merged by jenkins-bot:
Fix PHP implementation of mw.ustring %W

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

This change should be deployed to WMF wikis with 1.23wmf14, see https://www.mediawiki.org/wiki/MediaWiki_1.23/Roadmap for the schedule.