News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Regexp Verification Questions

Started by Josh @ Dreamland, April 20, 2011, 01:53:45 PM

Previous topic - Next topic

Josh @ Dreamland

Link to Mod

This is a simple mod that replaces simple strict-equivalence comparison on verification questions with a regexp test. At its simplest, this mod allows for multiple answers to verification questions.

In any typical case, this extension will not break existing verification answers; only those with special characters will be affected.

So, if you had the question, "One plus one equals...", and the answer "two", the answer will still work. But you can improve it by replacing it with "(tw?o?o|2)", which will lead to the acceptance of any of "to", "two", "too", "twoo", or "2". More simply, less elegantly, a less experienced user could enumerate them, "(two|too|to|2)".

My forum asks, "Name a yellow fruit." This is the answer:
(yellow )?(ba(nn|n)a(nn|n)a|lemon|(pine|pine |)apple|(pear|pare|pair))s?

Overkill? Probably. Useful? Yes.


dougiefresh

Thank you for the wonderful mod!  I thought I'd let everybody know that when I updated my forum from 2.0 RC5 to 2.0 Gold, I had to reinstall all my mods.  This mod installed without issues and without emulation.  Hope this info helps someone!

MotRude

installed this and it didn't work..uninstalled and now my registration is messed up..is there a code i need to delete or something?

Josh @ Dreamland

Mot: That sounds like very bad news. Could you tell me what version of SMF you attempted to install it on? You could probably just copy over new versions of the two patched files (Sources/Subs-Editor.php, Sources/ManageSettings.php) from the Default sources or from a clean install to fix any issues that arose. Failing that, feel free to pastebin those two files and I or someone else will correct them for you.

I would like to know whether or not this patch works on 2.0.1. I use it personally with 2.0; I suppose I can update my forum software and ensure it still works.

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Arantor

Holder of controversial views, all of which my own.

Jade Elizabeth

You made a regex type mod? ha ha

I love that I can put multiple answers in, cause some of mine are a bit off and I would love more general questions that can have a couple of answers ha ha.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Arantor

No, but I did make a mod that works for multiple languages of Q&A with multiple answers per question - without having to be regex (which is naturally harder for people to use)
Holder of controversial views, all of which my own.

Jade Elizabeth

OMG I saw that before and I didn't understand what multiple Q&A meant XD. Omg now I get you! Ha ha ha I feel so blonde. I might have to use that one, sorry Josh! <3
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Advertisement: