Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Seems you want to create something like regular expression out of set of example strings. This might be quite tricki in general. Found this link, not sure if it's relevant: <a href="http://scholar.google.com/scholar?hl=en&amp;rlz=1B3GGGL_enEE351EE351&amp;q=%22regular%20expression%20by%20example%22&amp;oq=&amp;um=1&amp;ie=UTF-8&amp;sa=N&amp;tab=ws%0A" rel="nofollow noreferrer"><a href="http://scholar.google.com/scholar?hl=en&amp;rlz=1B3GGGL_enEE351EE351&amp;q=%22regular%20expression%20by%20example%22&amp;oq=&amp;um=1&amp;ie=UTF-8&amp;sa=N&amp;tab=ws" rel="nofollow noreferrer">http://scholar.google.com/scholar?hl=en&amp;rlz=1B3GGGL_enEE351EE351&amp;q=%22regular%20expression%20by%20example%22&amp;oq=&amp;um=1&amp;ie=UTF-8&amp;sa=N&amp;tab=ws</a></a></p> <p>On the other hand, if you need only one specific wildcard meaning "0 or more characters", then it should be much easier. <a href="http://en.wikipedia.org/wiki/Levenshtein_distance" rel="nofollow noreferrer">Levenshtein distance</a> algorithm computes similarity between 2 strings. Normally only result is needed, but in your case the places of differences are important. You also need to adapt this for N strings.</p> <p>So I recommend to study this algorithm and hopefully you'll get some ideas how to solve your problem (at least you'll get some practice with text algorithms and dynamic programming).</p> <p>Heres algorithm in PHP: _http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#PHP</p> <p>You might want also to search for PHP implementations of "diff". <a href="http://paulbutler.org/archives/a-simple-diff-algorithm-in-php/" rel="nofollow noreferrer">http://paulbutler.org/archives/a-simple-diff-algorithm-in-php/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload