IF Computer > MINERVA > Manual > Reference > Predicates > Text Processing and Regular Expressions > match_all/3

match_all/3

MINERVA
ifcomputer logo
f
Expert Services on the Web

Test if the regular expression "regexp" accepts "string" and return list of matches

match_all(+regexp, +string, -matchlist)

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.

Arguments

	regexp              atom
	string              atom
	matchlist           atom

Examples

	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]]

Standard

This predicate is not part of the ISO-Prolog Standard.

See also

regular expression, match/2/3, match_all/3, substitute/4, substitute_all/4, split/2/3, chop/2, get_line/1/2,

document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/regexp/match_all/print_de.html
published 2008/8/25 update 1999/5/10 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
Back> managed with ubiCMS