Create regex from samples algorithm -


afaik no 1 have implemented algorithm takes set of strings , substrings , gives 1 or more regular expressions match given substrings inside strings. so, instance, if i'd give algorithm 2 samples:

string1 = "fwef 1234 asdfd" substring1 = "1234"  string2 = "asdf456fsdf" substring2 = "456" 

the algorithm give me regular expression "[0-9]*" back. know give more 1 regex or no possible regex , might find 1000 reasons why such algorithm close impossible implement perfection. what's closest thing?

i don't care regex also. want algorithm takes samples ones above , finds pattern in them can used find "kind" of text want find in string without having write regex or code manually.

flashfill new feature of ms excel 2013 task want, not give regular expression. it's np-complete problem , open question practical purposes. if you're interested in how synthesise string manipulation multiple examples, go flash fill official website , read few papers. have pseudo-code , demo. movies well.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -