Created
September 8, 2015 10:33
-
-
Save arcusfelis/5cb920589858b9eaa3e1 to your computer and use it in GitHub Desktop.
wtf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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