Auteur: Philip Hazel Date: À: 774 CC: pcre-dev Sujet: Re: [pcre-dev] [Bug 774] New: Capturing groups and alternatives
On Wed, 22 Oct 2008, Edwin Boatswain wrote:
> If I have a regular expression such as the following:
> ^Recv\(([\d/\-:\.]+)\)|Send\(([\d/\-:\.]+)\)
> Which is supposed to capture a timestamp from a line of text like:
> Send(10/06/2008-07:45:06.668)|8=FIX.4.2?9=00246...
> Note the string contains \a characters.
> I can match the line with the above expression but when I try to extract group
> 1 I get the entire string preceded by by some non-ascii characters.
Firstly, you should not expect group 1 to be set; the parentheses after
"Send" will be numbered 2. This works fine for me when I use pcretest
under Linux: