Erlang Programming/Using regexp

Regular ExpressionsEdit

2> re:run("hello world","w.+d").
{match,[{6,5}]}

The regular expression, "w.+d" matches the string, "hello world" at location 6 for 5 chars.

9> re:replace("10203040","([2-4]0)+","01",[{return,list}]).
"1001"

Makes a substitution, replacing "203040" with "01".

Last modified on 8 July 2010, at 21:07