Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regex help 1

Status
Not open for further replies.

rico14d

Programmer
Apr 8, 2002
135
GB
Hi,

I could'nt find a regex forum so being as im using VB at the moment, ill post here.

Im trying to test if a string contains 2 consecutive pairs e.g.
323535577091 true (5577)
312339565444 false

The closest i've got is (\d)\1(\d)\1
but this only matches if the 2 pairs are the same -
e.g.234333353 (3333)

Can anyone help please?

Thanks,
Rich
 
try:
(\d)\1(\d)\2

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top