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

Sarath27
8 - Asteroid

Hi All,

 

I want to write a regex to find a string which starts and ends with an Numerics. Please assist.

8 REPLIES 8
aatalai
15 - Aurora

create a new field push it through data cleanese say remove punctuation, numbers etc (everything but letters); then use this formula

 

left([field],1) =left([new field]) and  right([field],1) =right([new field]) , if true then starts and end with an alphabet character but @Sarath27 that would be not using regex

DataNath
17 - Castor
17 - Castor

@Sarath27 when you say 'find a string', are you looking to Filter? If so, the following expression will isolate only records that start and end with numbers (just replace [Input] with your own field):

 

 

IsInteger(Left([Input], 1))
&&
IsInteger(Right([Input], 1))

 

binu_acs
21 - Polaris

@Sarath27 

Regex_MATCH([Field),"^\d.*\d$")
Sarath27
8 - Asteroid

Hi Binu,

 

It shows as malfunction call

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @Sarath27,

 

@binu_acs is close but there's just an issue with the brackets used and the quotation marks:

 

Regex_MATCH([Field],'^\d.*\d$')

 

Kind regards,

Jonathan

cjaneczko
13 - Pulsar

@Jonathan-Sherman his use of double quotes is correct. You can use Single or Double quotes as long as both are the same.

Jonathan-Sherman
15 - Aurora
15 - Aurora

@cjaneczko they are but it's the use of two right unicode double quotation marks that's the issue, not the fact that it's a double quote.

 

Kind regards,

Jonathan

binu_acs
21 - Polaris

@Sarath27 I updated my original post as the answer was submitted from my phone which doesn't support the proper double quotes 

Labels
Top Solution Authors