Test if the regular expression "regexp" accepts "string" and return list of matches
match_all/3 Tests if the regular expression "regexp" accepts "string". Substrings in bracketed expressions are returned in sequence in "matchlist". "matchlist" is a list of lists, every list is the result of a possible match.
regexp atom string atom matchlist atom
match_all('%<(%w+)', ' one two three ', L)
=> L = [one,two,three]
match_all('((%w+)|(%s+))', 'a few tokens', L).
=> L = [[a,a,''],[' ','',' '],[few,few,''],[' ','',' '],[tokens,tokens,'']]
match_all('%<(%w+)', 'a few tokens', L).
=> L = [[a],[few],[tokens]]
This predicate is not part of the ISO-Prolog Standard.
| scroll to top |
|