[erlang-bugs] Re bug

Robert Virding robert.virding@REDACTED
Sat Mar 3 16:42:22 CET 2012


Hi Eric,

Yes, I know I can shorten it. The bug, as I see it, is that it suddenly gives up and returns 'nomatch' on a pattern/string which should match. Now I will admit that this is a very pathological pattern and that the time taken to match grows exponentially (I think) and if you give n=30 you will have to wait a long time. But if it gives up it should tell me that, perhaps return an error or crash, not lie.

Hadn't noticed the 69, but of course 23+46=69 :-)

Robert

----- Original Message -----
> Hi Robert,
> 
> your pattern can be shorten to a{0,n}a{n} and this way 23 is working.
> 
> 4> re:run("aaa", "a?a?a?aaa").
> {match,[{0,3}]}
> 5> re:run("aaa", "a{0,3}a{3}").
> {match,[{0,3}]}
> 6> re:run(string:copies("a",23), "a{0,23}a{23}").
> {match,[{0,23}]}
> 7> re:run(string:copies("a",24), "a{0,24}a{24}").
> {match,[{0,24}]}
> 
> looks like this is a pattern string length limitation to more than
> 22*2
> + 22 = 66 and less than 23*2 + 23  = ... 69 ...
> 
> hum looks like it is not only pathological but sexual too :>) !!!!!
> 
> hope it can help...
> 
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs
> 



More information about the erlang-bugs mailing list