https://bugzilla.wikimedia.org/show_bug.cgi?id=48331

       Web browser: ---
            Bug ID: 48331
           Summary: mw.string.gsub doesn’t support %f (“frontier”) search
                    pattern
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Scribunto
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
    Classification: Unclassified
   Mobile Platform: ---

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to