LINUX.ORG.RU
ФорумTalks

[Google][Регулярные выражения] RE2

 ,


0

0

Почти PCRE библиотека от гугла под BSD-style лицензией: RE2: a principled approach to regular expression matching

Для Ъ:

... we've built a new regular expression engine, called RE2, which is based on automata theory and guarantees that searches complete in linear time with respect to the size of the input and in a fixed amount of stack space.

Бенчмарки


Прикольно. Можно попробовать заюзать...

Divius ★★
()

Спасибо, очень интересно

runtime ★★★★
()
Ответ на: комментарий от name_no

эм, быстрее?

System                                  PCRE     RE2
AMD Opteron 8214 HE, 2.2 GHz            0.8 µs	0.5 µs
Intel Core2 Duo E7200, 2.53 GHz         0.4 µs	0.3 µs
Intel Xeon 5150, 2.66 GHz (Mac Pro)     0.6 µs	0.3 µs
Intel Core2 T5600, 1.83 GHz (Mac Mini)  0.7 µs	0.4 µs

Time to match ([0-9]+)-([0-9]+)-([0-9]+) in 650-253-0001.
System                                  PCRE     RE2
AMD Opteron 8214 HE, 2.2 GHz            0.6 µs	2.9 µs
Intel Core2 Duo E7200, 2.53 GHz         0.3 µs	2.1 µs
Intel Xeon 5150, 2.66 GHz (Mac Pro)     0.4 µs	2.3 µs
Intel Core2 T5600, 1.83 GHz (Mac Mini)  0.5 µs	2.5 µs

Time to match [0-9]+.(.*) in 650-253-0001.

и уж, если новую либу сравнивают с проверенной временем, ото наверное проверенная временем является более каноничной, а ще оно на С

shty ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.