| Format | regex_match(+REGEX, +TARGET) | ||||||
|---|---|---|---|---|---|---|---|
| Arguments |
| ||||||
| Success if regular expression REGEX matches the TARGET. | |||||||
> ?- regex_match("i+", "lilfes").
yes
| |||||||
| Format | regex_match(+REGEX, +TARGET, -RESULT) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Arguments |
| |||||||||
| Get partial strings matched the regular expression. | ||||||||||
> ?- regex_match("(hoge)(poge)", "hogepoge",X).
X: < "hogepoge", "hoge", "poge" >
| ||||||||||
| Format | regex_match(+REGEX, +OPTIONS, +TARGET, -RESULT) | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Arguments |
| ||||||||||||
| Note | The folowing options can be used.
| ||||||||||||
| Get partial strings matched the regular exoression. | |||||||||||||
> ?- regex_match("(a)+", ["i"], "aAbbaaa",X).
X: < "aA", "a" >
> ?- regex_match("(a)+", ["i", "g"], "aAbbaaa",X).
X: < "aA", "aaa" >
| |||||||||||||
| Format | regex_subst(+REGEX, +SUBST, +TARGET, -RESULT) | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Arguments |
| ||||||||||||
| Displace strings matched regular expression REGEX that is a part of TARGET with string SUBST. | |||||||||||||
> ?- regex_subst("hoge", "poe", "hoge-pe-n", X).
X: poe-pe-n
| |||||||||||||
| Format | regex_subst(+REGEX, +OPTIONS, +SUBST, +TARGET, -RESULT) | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Arguments |
| |||||||||||||||
| Note | The folowing options can be used.
| |||||||||||||||
| Displace strings matched regular expression REGEX that is a part of TARGET with string SUBST. | ||||||||||||||||
> ?- regex_subst("l+", ["i"], "m", "LiLFeS", X).
X: miLFeS
> ?- regex_subst("l+", ["i", "g"], "m", "LiLFeS", X).
X: mimFeS
| ||||||||||||||||