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:
Name | Value |
ApolloVersion | 9 |
What I would like:
Name | Value |
ApolloVersion | 9.0.042 |
Keep in mind, the value field can also be letters.
Thanks in advance!
Kerry
Solved! Go to Solution.
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
This worked perfectly, Thank you!