String matching: Difference between revisions

Content added Content deleted
Line 3,451: Line 3,451:


=={{header|Picat}}==
=={{header|Picat}}==
The two most common predicate to use for string matching is find/4 (find a substring) or append/3 (a general purpose reversible predicate for concatenating/splitting lists/strings). Both predicates are non-deterministic and can yield multiple solutions, e.g. together with findall/2.
The two most common predicate to use for string matching is <code>find/4</code> (find a substring) or <code>append/3</code> (a general purpose reversible predicate for concatenating/splitting lists/strings). Both predicates are non-deterministic and can yield multiple solutions, e.g. together with <code>findall/2</code>.


<lang Picat>import util.
<lang Picat>import util.
Line 3,518: Line 3,518:
positions = [[9,16],[21,28]]
positions = [[9,16],[21,28]]
positions = [[5,5],[8,8],[10,10],[17,17],[20,20],[22,22]]</pre>
positions = [[5,5],[8,8],[10,10],[17,17],[20,20],[22,22]]</pre>



=={{header|PicoLisp}}==
=={{header|PicoLisp}}==