Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2004-06-15 04:59:08


> I'm having some difficulty getting my regular expression working.
> Basically, I need to make sure that a UK postcode is valid.
> The postcode that is passed to my function sometimes has extra things with
> it such as:

Have you looked at http://regexlib.com/REDetails.aspx?regexp_id=260 as it
seems to get a high rating.

> It now seems to be failing to find the postcode in the above examples.
> Also, when I pass my function a postcode that I know is invalid, such as
JG2
> 7L5 it matches it as G2 7L5 instead of failing to do the match.

Try prefixing with \< to insist that the match starts at a word boundary.

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