In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more 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