Last modified: 2013-11-15 11:08:05 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
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.
Related URL: https://gerrit.wikimedia.org/r/63381 (Gerrit Change Ie0b95ef5b734db53d6adc9de5dae4874f8944c08)
Change 63381 merged by jenkins-bot: Add frontier pattern (%f[set]) to ustring https://gerrit.wikimedia.org/r/63381
Merged. This should be deployed on WMF wikis with 1.22wmf16, see https://www.mediawiki.org/wiki/MediaWiki_1.22/Roadmap for the schedule.
Change 95405 had a related patch set uploaded by MarkAHershberger: Add frontier pattern (%f[set]) to ustring https://gerrit.wikimedia.org/r/95405
Change 95405 abandoned by MarkAHershberger: Add frontier pattern (%f[set]) to ustring https://gerrit.wikimedia.org/r/95405
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.