Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

RegEx extract numbers before and after text string

EJ_Alt
7 - Meteor

Hi All,

 

I would appreciate some help with using a RegEx or suitable tool to do this. Essentially extract all digits before and after text

 

Account IDID 1ID2ID3
1234D983.221234D983.22
12N4445.5612N4445.56
4Z33.334Z33.33

 

Thanks

5 REPLIES 5
IraWatt
17 - Castor
17 - Castor

Hey @EJ_Alt,

Here is one way to do this with Regex

([\d\.]+)(\D+)([\d\.]+)

IraWatt_0-1661620626704.png

The first and third group captures one or more number characters or points '.':

([\d\.]+)

The second group captures any non number characters:

(\D+)

If you want to learn more about Regex the community has some really quick interactive videos on getting to grips with it here https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Parsing%20...

 

Any questions or issues please ask

Ira Watt
Technical Consultant
Watt@Bulien.com 

 

binuacs
21 - Polaris

@EJ_Alt Another way of doing this

 

binuacs_0-1661639065024.png

 

Alteryx_AR
12 - Quasar

@EJ_Alt 

 

I used following expression to parse. Hope this helps you.

 

Alteryx_AR_0-1661652331674.png

 

Alteryx_AR_2-1661652382419.png

 

 

 

EJ_Alt
7 - Meteor

Thanks!

EJ_Alt
7 - Meteor

Thanks! works too.

Labels