خرید بک لینک

Vote count: 0

These are equivalent:

grep -E '^A|bA'
grep -P '^A|bA'
grep -P '(?<![^b])A'

But the second one, grep -P '^A|bA', is multiple times slower. Why?

They all find the same thing: a line with an A at the begiing or after a b. (Equivalently, a line with an A not preceded by anything other than a b.)

Is the second line disabling some optimization? Does grep check multiple characters in parallel when it thinks that's faster? I can't come up with another explanation, unless the ^ or | means something subtly different in perl.

asked 47 secs ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 11 مرداد 1395 ساعت: 11:41

صفحه بندی