Boost logo

Boost Users :

From: John Maddock (john_maddock_at_[hidden])
Date: 2003-04-29 06:16:51


> Here's a question I can't answer. I'm using regexp to dig out strings from
data received via Ham Radio, so the txt often is corrupted.
>
> What I want to match is two consecutive callsigns separated by whitespace,
for example 'hb9drv hb9drv' but not 'hb9drv hb9drX'.
>
> I can define the match condition for a callsign, but can I use the match
option {2,3} somehow to match the same callsign two or three times?
Effectively match the same word two or three times?
>
> Help received with much thanks,

How about: (\w+)(?:\s+$1)+

John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net