Skip to content

Instantly share code, notes, and snippets.

@arcusfelis
Created September 8, 2015 10:33
Show Gist options
  • Save arcusfelis/5cb920589858b9eaa3e1 to your computer and use it in GitHub Desktop.
Save arcusfelis/5cb920589858b9eaa3e1 to your computer and use it in GitHub Desktop.
wtf
make_element(Src) ->
<img src={Src} />.
digits_only(Src) ->
MP = /^\s*\d+\s*$/,
re_test(Str, MP).
digits_only2(Src) ->
Re = "^\\s*\\d+\\s*$",
{ok,MP} = re:compile(Re),
re_test(Str, Re).
re_test(Str, MP) ->
case re:run(Str, MP, []) of
{match,_} -> true;
_ -> false
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment