parsing text

Steve Davis steven.charles.davis@REDACTED
Sat May 1 23:35:02 CEST 2010


Purely out of interest and for offering other approaches, my first
instinct was:

Bin = <<"<B>Page Counter</B></TD><TD>4880</TD></TR>">>,
{match, [{Index,Length}]} = re:run(Bin, <<"[0-9]+">>),
<<_:Index/binary, Num:Length/binary, _/binary>> = Bin,
list_to_integer(binary_to_list(Num)).

/s


More information about the erlang-questions mailing list