I have the following string.
Andrew – BOB – Jay vs John
Now all Four names can change at any time, my only true concern however is with isolating Jay vs John independent of the names before the constant in this, is that the format always follows
world1 - world2 - X vs Y
How do I check for X vs Y disregarding the first 2?
I’ve tried.
'%- (.*?) Vs (.*)$%';
TO no avail.
Any help would be greatly appreciated.
Also – following a suggestion how do I deal with the test case in which I wish to disregard everything to the far left other than the name of the two participants — examples include..
www.GrindTimeNow.NET: Magz vs K-mo (Tryouts)
SMACK/ URL PRESENTS JC VS GA
POISONPEN.TV PRESENTS PH VS DIRT BAG DAN
KOTD - Rap Battle - Arsonal vs Illmaculate
DON'T FLOP - Rap Battle - Arkaic Vs Dekay
So, you just need to capture two names separated by ‘vs’ and some space. This should work:
See a demo at regexr