I've started working for Lambdaclass and getting to know Erlang. As preparation for interviews with potential clients I got an assignment based on ...
For further actions, you may consider blocking this person and/or reporting abuse
<3 for using Erlang. Although it may look strange people using C-Style syntax or other scripting languages, Erlang and the Erlang VM (BEAM) has a ton of great features and concepts that gets slowly added to other more popular languages.
I also love RegExs so that was a great read for me :)
You might mention, that most actual productive implementation do compile a regular expression on runtime to executable code for performance reasons.
Hey, nice job.
Actually, you can fit it in less than 40 lines just reordering some of the clauses and using the fact that:
is equivalent to:
since
matching/2
returns a boolean.Here's my (I believe equivalent) version:
(I used
search
andmatch
names since they are similar to how pythonre
module works, wheresearch
looks anywhere in the string andmatch
has to match from the beginning of the string)Haven't tested a lot of cases, but seems to be working. :)
Nice catch!