reg exp help.

Associate
Joined
1 Jun 2007
Posts
824
Stuck on a simple reg exp.

I have team names like:

team v teamb
teamc v teamf
weqeq v uiuoiuio
nbnbmb v hhjhj

Ive written this regular expression to get the 2nd team:

(?<=\sv\s).+

Which works but in the data there is also teams with an additional space - which it fails to grab. Like:

dfdfdf v jhjhjh
kjkljlj v teamx <--- 2 spaces before teamx, you cant see it on forum properly.

Im using PCRE based reg expressions it wont allow \s+ in positive lookbehinds.

Anyone help?
 
Last edited:
There isnt much difference between (?<=\sv\s).+ and (?<=\sv\b).+

I would have liked the get the 2nd teams without triming the spaces out of my variable but thats what im doing now.

Would have liked to figure it out in regexp just for curiosity sake.
 
Back
Top Bottom