Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Case Name and RegEx

Biernt
6 - Meteoroid

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? 

3 REPLIES 3
ImadZidan
12 - Quasar

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

TerryT
Alteryx Alumni (Retired)

I would make the 's' in 'vs' optional with '?':

 

(.*?)\s+vs?\.\s+(.*)

 

Terry T

Biernt
6 - Meteoroid

This also worked as a solution. Thank you for your insight, Imad. 

Labels
Top Solution Authors