community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Regular Expression

Meteoroid

Hello, I am attempting to parse field information from xml data using a regular expression. The issue I am facing seems simple, but I am not familiar enough with regex to think through it.

 

My Expression:

[<](\<\w+\>)[>](\<\w+\>)

 

This expression feels very close to what I need; however, within my second matched pair, I would also like to parse out non-word characters (periods/decimals specifically) . The kicker is that I also want to include letters as well if they are there. 

 

Example:

<ApolloVersion>9.0.042</ApolloVersion>

 

My expression, as you can tell, will return two columns that I am calling Name and Value.

 

Those two columns look like:

NameValue
ApolloVersion9

 

What I would like:

Name

Value

ApolloVersion9.0.042

 

Keep in mind, the value field can also be letters.

 

Thanks in advance!

Kerry

Bolide

@Kerry,

 

I think you just want the ".*" it will give you any number of characters. Below should work.

 

 

EDIT: this is incorrect disregard for now.

[<](\<\w\>)[>](.*)[<]

 

EDIT: Okay Below should work:

 

[<](\<\w+\>)[>](.*)[<]

 

Best,

MSalvage

Meteoroid

This worked perfectly, Thank you!

Labels