Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Josh @ Dreamland on April 20, 2011, 01:53:45 PM

Title: Regexp Verification Questions
Post by: Josh @ Dreamland on April 20, 2011, 01:53:45 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2984)

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.
Title: Re: Regexp Verification Questions
Post by: Masterd on April 22, 2011, 04:16:46 PM
Nice mod! :D
Title: Re: Regexp Verification Questions
Post by: dougiefresh on June 15, 2011, 02:39:48 PM
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!
Title: Re: Regexp Verification Questions
Post by: MotRude on August 25, 2011, 08:39:48 PM
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?
Title: Re: Regexp Verification Questions
Post by: Josh @ Dreamland on November 30, 2011, 11:36:06 AM
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.
Title: Re: Regexp Verification Questions
Post by: Jade Elizabeth on July 30, 2014, 10:14:18 AM
Nice! I love this a lot :D.
Title: Re: Regexp Verification Questions
Post by: Arantor on July 30, 2014, 10:15:38 AM
As opposed to mine? :'(
Title: Re: Regexp Verification Questions
Post by: Jade Elizabeth on July 30, 2014, 10:21:42 AM
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.
Title: Re: Regexp Verification Questions
Post by: Arantor on July 30, 2014, 10:22:57 AM
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)
Title: Re: Regexp Verification Questions
Post by: Jade Elizabeth on July 30, 2014, 10:28:37 AM
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