< Erlang Programming
Regular Expressions
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".
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.