match_all/3

正規表現regexpがstring(文字列)を受け入れるかどうか調べて、マッチするリストを復帰します。

match_all(+regexp, +string, -matchlist)

match_all/3は、正規表現「regexp」がstringを受け入れるかどうか調べます。 括弧に入れられた表現における文字列の一部分は、matchlistの中で順序を保って帰されます。 matchlistはリストのリストです、あらゆるリストは起こりうるマッチの結果です。

引き数

	regexp              アトム
	string              アトム 
	matchlist           アトム

例題

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

標準

この述語は、ISO-Prolog標準の要件ではありません。

以下も参照して下さい

正規表現, match/2/3, match_all/3, substitute/4, substitute_all/4, split/2/3, chop/2, get_line/1/2,


戻る 続く..