[erlang-questions] String Pattern Matching
Sun Sep 7 20:47:46 CEST 2008
On Sun, Sep 07, 2008 at 10:02:37AM -0400, Luke Galea wrote:
} I get the sense that most erlangers feel that regular expressions
} aren't needed and that pattern matching can do the job.
} ([m|l])ouse$ -> $1ice
L = lists:reverse(Word),
singularize1("ecil" ++ L) ->
"esuol" ++ L;
singularize1("ecim" ++ L) ->
"esuom" ++ L.
If you're really just dealing in words the penalty of a double
reverse isn't as bad as the penalty of having to use REs.
More information about the erlang-questions