View Single Post
Old 06-13-2013, 04:23 PM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by koliberek View Post
There is something strange in regex search. I can't imagine how it works:



Pattern is in the beginning, in the middle or even as a part of word. And there is no any special character in the pattern! Is this the way it should work?
Yes. An unanchored pattern will match any subpart of the item. That is what regexps do.

If you want to be sure that the pattern is matching the beginning, the end, or all of the item then you must include anchor specifications in the regexp. If you put the anchor ^ at the beginning of the regexp then the pattern must match at the beginning of the item. Of you put the anchor $ at the end of the regexp then the pattern must match the end of the item. Include them both to indicate you want both the beginning and the end, that is the entire item.
chaley is offline   Reply With Quote