Last modified: 2013-11-15 11:08:05 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 T50331, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48331 - mw.ustring.gsub doesn’t support %f (“frontier”) search pattern
mw.ustring.gsub doesn’t support %f (“frontier”) search pattern
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
unspecified
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Brad Jorsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-10 17:58 UTC by Michael Zajac
Modified: 2013-11-15 11:08 UTC (History)
3 users (show)

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


Attachments

Description Michael Zajac 2013-05-10 17:58:13 UTC
The %f (“frontier”) pattern is used to match a set’s boundary. It is the only way to perform some searches. It is an undocumented feature of Lua 5.1, officially documented starting in Lua 5.2.

It works in string.gsub, but not in mw.string.gsub. For example, in the debug console: 

 > string.gsub ("THE (QUICK) brOWN FOx JUMPS", "%f[%a]%u+%f[%A]", print)
 THE
 QUICK
 JUMPS
 > mw.ustring.gsub ("THE (QUICK) brOWN FOx JUMPS", "%f[%a]%u+%f[%A]", print)

Since mw.ustring.gsub is supposed to be “much like string.gsub(),” this pattern should be supported.


== Reference ==

Lua-Users.org: “Fronter Pattern”
http://lua-users.org/wiki/FrontierPattern

Lua 5.2 documentation: “Patterns”
http://www.lua.org/manual/5.2/manual.html#6.4.1

Scribunto docs: “mw.ustring.gsub”
https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.ustring.gsub
Comment 1 Brad Jorsch 2013-05-10 18:53:12 UTC
I was actually looking at that the other weekend. I should finish it up.

I would have done it when I wrote mw.ustring, but I didn't know at the time it existed undocumented in 5.1.
Comment 2 Gerrit Notification Bot 2013-05-12 15:08:09 UTC
Related URL: https://gerrit.wikimedia.org/r/63381 (Gerrit Change Ie0b95ef5b734db53d6adc9de5dae4874f8944c08)
Comment 3 Gerrit Notification Bot 2013-08-30 06:22:41 UTC
Change 63381 merged by jenkins-bot:
Add frontier pattern (%f[set]) to ustring

https://gerrit.wikimedia.org/r/63381
Comment 4 Brad Jorsch 2013-08-30 13:50:41 UTC
Merged. This should be deployed on WMF wikis with 1.22wmf16, see https://www.mediawiki.org/wiki/MediaWiki_1.22/Roadmap for the schedule.
Comment 5 Gerrit Notification Bot 2013-11-14 15:19:53 UTC
Change 95405 had a related patch set uploaded by MarkAHershberger:
Add frontier pattern (%f[set]) to ustring

https://gerrit.wikimedia.org/r/95405
Comment 6 Gerrit Notification Bot 2013-11-14 16:47:22 UTC
Change 95405 abandoned by MarkAHershberger:
Add frontier pattern (%f[set]) to ustring

https://gerrit.wikimedia.org/r/95405
Comment 7 Andre Klapper 2013-11-15 11:08:05 UTC
No open patches to review here (backport patches got abandoned), hence resetting status to RESOLVED FIXED. Backport_to_Stable flag might be set to "-" by hexmode.

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


Navigation
Links