I had asked a similar question previously.
I'm using the RegEx parse function to breakdown case titles for court dockets consisting of:
[plaintiff] v. [defendant]
[plaintiff] vs. [defendant]
I was working with a data set that only included the format of [plaintiff] v. [defendant], which the expression: (.*?)\s+v\.\s+(.*) worked perfectly for. This, however, did work with data sets that include both [plaintiff] v. [defendant] & [plaintiff] vs. [defendant] formats. Is there a RegEx I can write that accounts for both of these formats, or is the solution something different entirely?
Solved! Go to Solution.
Hello @Biernt ,
I believe the expression should include an OR operator. It is hard to say without sample data.
Give it a try.
(.*?)\s+v|vs\.\s+(.*)
Hope this is helpful
I would make the 's' in 'vs' optional with '?':
(.*?)\s+vs?\.\s+(.*)
Terry T
This also worked as a solution. Thank you for your insight, Imad.