Topic on Extension talk:RegexFunctions

Migrating from Regex Fun to RegexFunctions

3
Summary by Jaideraf

Using unnamed parameters ({{#rmatch:|||}}) does not work, but using named ones does ({{#rmatch:|pattern=|then=|else=}}).

Jaideraf (talkcontribs)

Hi @Skizzerz, I am migrating from the Regex Fun extension to the RegexFunctions extension, but I couldn't get the same result from this regex, could you please help me?


Input: $a São Paulo :$b Fundação Perseu Abramo,$c 2013.

Result expected: Fundação Perseu Abramo,


Regex Fun:

{{#regex:$a São Paulo : $b Fundação Perseu Abramo, $c 2013.|/\$b(.*?)(?=\$){{!}}\$b(.*)/}}

Result: Fundação Perseu Abramo,

RegexFunctions:

{{#rmatch:$a São Paulo : $b Fundação Perseu Abramo, $c 2013.|/\$b(.*?)(?=\$){{!}}\$b(.*)/|$1}}

Result: (nothing)

Maaartyyynaa (talkcontribs)

try {{#rmatch:$a São Paulo: $b Fundação Perseu Abramo, $c 2013.|pattern=/\$b(.*?)(?=\$)|\$b(.*)/|then=$1|else=failure}} as a result I got Fundação Perseu Abramo,

Jaideraf (talkcontribs)

Thank you! You just have solved the mystery. Using unnamed parameters does not work, but using named ones does. Interesting.

Reply to "Migrating from Regex Fun to RegexFunctions"