On Fri, 10 May 2013, [email protected] wrote:

> *.txt ---------------------------> (?=.*\.txt$)

And one more thing: the most efficient pattern for "ends with .txt" is

  .*(?<=\.txt)
  
The .* rushes to the end of the pattern; then there is a lookbehind to 
check the last 4 characters. That's it. Your pattern will skip to the 
end, then backtrack *all the way to the start*, trying to match \.txt$
at each position. Not optimal. (Pattern matchers can be quite dumb.)

Philip

-- 
Philip Hazel

-- 
## List details at https://lists.exim.org/mailman/listinfo/pcre-dev 

Reply via email to