How would I do regex matching in Erlang?
All I know is this: f("AAPL" ++ Inputstring) -> true.
The lines that I need to match "AAPL,07-May-2010 15:58,21.34,21.36,21.34,21.35,525064\n"
In Perl regex: ^AAPL,* (or something similar)
In Erlang?
Use the re
module, e.g.:
...
String = "AAPL,07-May-2010 15:58,21.34,21.36,21.34,21.35,525064\n",
RegExp = "^AAPL,*",
case re:run(String, RegExp) of
{match, Captured} -> ... ;
nomatch -> ...
end,
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With