From: Robert Klemme Date: 2009-04-08T19:00:13+09:00 Subject: Re: Concatenating Regex Smartly On 08.04.2009 11:47, Shak Shak wrote: > Is there a way of quickly concatenating two full string patterns in a > way that takes into account the boundaries? So for example: > > \A\d+\Z and \A[a-z]+\Z IIRC the "Z" must be lower case. > would give: > > \A\d+[a-z]+\Z > > ? > > Or is this a context sensitive situation where I'd have to parse and > join it myself? If so, what is the best way to "tokenise" a pattern? Why do you have to parse them? There is a bit of context missing but without further facts I would recommend to keep individual patterns without the start and end anchors and only apply those after constructing the full regexp that you want to use. My 0.02 EUR... Kind regards robert