Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Regex Question

alteryx_user_9999
6 - Meteoroid

For the following Regex

 

[A-Za-z]*\s([A-Za-z]{1}\.)*([A-Za-z]{1}\.),{1}.*?Arizona State University

 

I'm getting the following error 

 

The Regular Expression in ParseSimple mode can have 0 or 1 Marked sections, no more.

 

Can someone explain what this error means? And a way to fix the above regex to avoid this error?

 

Thank you.

6 REPLIES 6
adamweaver39
9 - Comet

Hey @alteryx_user_9999 -- could you provide a little context? Are you using the RegEx tool, or a RegEx formula in a different tool?

It would be helpful to get an example of the data you are working with and how you would like to see it parsed.

alteryx_user_9999
6 - Meteoroid

hi @adamweaver39 ,

 

I've answered my question, but I could use help on the following. I'm trying to parse

 

Chandwani A.H.M., Power Electronics and Control Engineering (PEACE) Laboratory; Ira A. Fulton School of Engineering, Arizona State University, Tempe.; Dey S., Power Electronics and Control Engineering (PEACE) Laboratory; Ira A. Fulton School of Engineering, Arizona State University, Tempe.; Mallik A., Power Electronics and Control Engineering (PEACE) Laboratory; Ira A. Fulton School of Engineering, Arizona State University, Tempe. (e-mail: ayan.mallik@asu.edu)

 

to

 

Chandwani A.H.M., Power Electronics and Control Engineering (PEACE) Laboratory; Ira A. Fulton School of Engineering, Arizona State University

Dey S., Power Electronics and Control Engineering (PEACE) Laboratory; Ira A. Fulton School of Engineering, Arizona State University

Mallik A., Power Electronics and Control Engineering (PEACE) Laboratory; Ira A. Fulton School of Engineering, Arizona State University

 

 

I think the following regex would work

 

[A-Za-z]*\s([A-Za-z]{1}\.)*([A-Za-z]{1}\.),{1}.*?Arizona State University

 

but the issue is that alteryx uses parentheses to do "marked expressions" causing the search to only match items within the marked expression. Do you know how I can repeat a sub expression in a regex in alteryx? Thank you. 

adamweaver39
9 - Comet

Hi @alteryx_user_9999 , I am not entirely sure I understand the question -- what is the specific change you are trying to create for your output? It looks like you are wanting to remove "Tempe.;" and the email "(e-mail: ayan.mallik@asu.edu)" called out at the end?

alteryx_user_9999
6 - Meteoroid

Hi @adamweaver39 ,

 

Thanks for following up. Given a string of text, I want to extract all subtext of the form

 

Last Name, First initial (maybe middle initial as well)., ... Arizona State University

 

from that text. I'm using the Tokenize Output Method in the regex tool. I'm hoping to extract all subtext of the form given above into separate rows. The issue I'm having is when there is a first initial, middle initial, etc., when doing the parsing. 

 

In the previous quote, the first block of text is the given string of text; the next is what I am trying to parse to rows. 

 

Let me know if there is anything I can clarify.

 

Thanks. 

adamweaver39
9 - Comet

Hey @alteryx_user_9999 -- I formulated a 3 step RegEx flow that accomplishes this. Let me know if that helps.

Parse3Parse3Parse2Parse2Parse1Parse1

flying008
15 - Aurora

Hi, @alteryx_user_9999 

 

FYI.

 

(?<=University).+?\s?(?=[A-Z\s]+?\.,|$)

 

 

录制_2024_04_11_09_33_44_536.gif

录制_2024_04_11_09_24_15_486.gif

Labels
Top Solution Authors