From: Oleksii T. <ole...@gm...> - 2013-05-29 21:22:10
|
28.05.13 11:00, Schrober написав(ла): > [this is a resent because the mail was dropped somewhere before reaching the > mailing list] > > Hi, > > I wanted to use re2c to implement some matching like functionality in a buffer > which is defined by its location in memory and length (so, the length is not > detectable by some symbol after the content of the buffer). The matching > should find some regular expression. The matching can be for example a string > in the middle of the buffer e.g. ".*foobar". Or two strings separated by some > other values e.g. ".*foo.*bar". The limitations can also be some ranges > ".*bar[0-9]+foo". I would expect a buffer to be filled with "Bbar21fooXXXX" to > return that it matched against ".*bar[0-9]+foo" > > re2c seemed to be to implement something like this without sacrificing too > much speed. Unfortunately, my first approach doesn't seem to work and says > YYFILL called for all strings. > > I am currently completely baffled by the result and unsure how to proceed. > I've attached the original testcase (test.re) and a simpler form without the > any expressions (simple.re). Only "veryloneteststring" matches in the simple > example, but also "foo" and "fooX" should match. > > Also the code taken from the comments of bug 2407218 (which say how the user > problem could be resolved) doesn't seem to work for me. The example is > attached and "a" or "abbbb" don't match and instead have as return code that > YYFILL was called. > > My version of re2c is re2c 0.13.5 (0.13.5-1 from Debian) Try to disable yyfill, since for fixed size matched strings it is pretty much useless -- Best regards, Oleksii Taran |