Erlang (programming language)/Tutorials/regexp: Difference between revisions
imported>Eric Evers (New page: =Regular Expressions= Regular Expressions 2> regexp:match("hello world","w.+d"). {match,7,5} The regular expression, "w.+d" matches th...) |
imported>Tom Morris m (Erlang programming language/Tutorials/regexp moved to Erlang (programming language)/Tutorials/regexp) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{subpages}} | |||
=Regular Expressions= | =Regular Expressions= | ||
Latest revision as of 06:07, 8 August 2009
The metadata subpage is missing. You can start it via filling in this form or by following the instructions that come up after clicking on the [show] link to the right. | |||
---|---|---|---|
|
Regular Expressions
2> regexp:match("hello world","w.+d"). {match,7,5}
The regular expression, "w.+d" matches the string, "hello world" at location 7 for 5 chars.
9> regexp:sub("10203040","([2|3|4]0)+","01"). {ok,"1001",1}
Makes a substitution, replacing "203040" with "01".