3
The idea here is to write a little segment that will spit out regular expression patterns when given a string that matches them.
As you might have guessed, this will be a popularity contest, and I'll accept whichever answer has the most upvotes by March 7th
pseudocode Example:
print(reverseRegex('dog'));
//prints /[a-z]{3}/, /dog/, and a bunch other stuff
EDIT: The regular expressions spat out should not exceed 3 times the input string's length
3I think the spec could do with tightening. There are countably infinitely many families of countably infinitely many regexes which match any given string. – Peter Taylor – 2014-02-23T17:24:54.463
What if the input string is longer than 30 chars? – Doorknob – 2014-02-23T18:10:56.863
@doorknob good point, will revise again – user70585 – 2014-02-23T18:11:37.930
Now your sample output violates your own rules. – Doorknob – 2014-02-23T18:15:29.247
Will fix :P where would I be without you... – user70585 – 2014-02-23T18:16:29.763
1
Maybe in the sandbox: http://meta.codegolf.stackexchange.com/questions/954/proposed-questions-sandbox-mark-8
– None – 2014-02-23T19:17:25.140