re:run reports incorrect match position

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

re:run reports incorrect match position

Alexander Zhuravlev-2
Hello,

I am not sure if this is a bug in R13B04 or not, but I am experiencing
the following issue:

1> re:run([1058,1077,1089,1090] ++ "http://example.com/index.php?a=b", "http", [unicode]).
{match,[{8,4}]}

I am trying to find position of a match in a string (list, not a binary) with unicode
characters. Since the string has 4 unicode symbols and then the matching
part I suppose that re:run should return {match, [{4,4}]} when I pass a
list, and {match, [{8, 4}]} when I pass a binary. Right now it returns
{match, [{8, 4}]} in both cases.
Is this a bug? If not, how can I get position of a match in unicode string?

Thank you.
--
Alexander Zhuravlev

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]