RosettaCodeData/Task/Regular-expressions/Forth/regular-expressions.fth
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

19 lines
391 B
Forth

include ffl/rgx.fs
\ Create a regular expression variable 'exp' in the dictionary
rgx-create exp
\ Compile an expression
s" Hello (World)" exp rgx-compile [IF]
.( Regular expression successful compiled.) cr
[THEN]
\ (Case sensitive) match a string with the expression
s" Hello World" exp rgx-cmatch? [IF]
.( String matches with the expression.) cr
[ELSE]
.( No match.) cr
[THEN]