Topic on Extension talk:Semantic Forms Inputs

regexp input type is not working

8
Summary by F.trott

Regexp was fixed and transferred to SemanticForms 3.4.3. It was removed from SFI 0.10.

Ace.philscan (talkcontribs)

The regexp input type show here Extension:Semantic Forms Inputs#Regular expression filter is not working.

Attached is the error that I encountered when trying to save '0' integer

And the error message above can't be removed since the form cannot be resubmitted when the 'Save page' is click.

Here's the field definition:

{{{field|dividend_most_recent|placeholder=Most Recent|input type=regexp|regexp=/^\d*$/|message=Please enter decimal/numbers!|base type=regexp|base prefix=filter2|filter2.regexp=/^.{0,10}$/|filter2.message=Please enter only up to 10 digits!|filter2.base type=regexp}}}

Please help

Jongfeli (talkcontribs)

This has been reported a while back, see: T97023. Wich version of MW are you using?

Ace.philscan (talkcontribs)
Ace.philscan (talkcontribs)

Also the Semantic Versions, thanks.

Installed extensions

Kc5vcx (talkcontribs)

regex input type seems broken in MW 1.26.0 too, doesn't do any checking.

Oetterer (talkcontribs)

For me (on mw 1.25.5), it works if I omit the enclosing slashes. So instead of writing

{{{field|foo|input type=regexp|regexp=/^[0-9A-Za-z ]+$/}}}

I use

{{{field|foo|input type=regexp|regexp=^[0-9A-Za-z ]+$}}}
F.trott (talkcontribs)

Regexp was fixed and transferred to SemanticForms 3.4.3. It was removed from SFI 0.10.

Ace.philscan (talkcontribs)

Thank you. It works :)..