Forum Discussion
CloudMe
Sep 28, 2019Copper Contributor
Regex Question
Hi,
How can i extract a single value from a string:
ABC XXXXX DEF
I know my XXX value will always be between ABC and DEF but i can't find a way to extract it without extracting the ABC and DEF as well. extract("ABC .+ DEF"
Is there a way to only extract the .+ and ignore the rest?
Thank You.
Would this work?
print t= "ABC XXXXX DEF" | parse t with *"ABC" theInfo "DEF"* | project theInfo
2 Replies
- zachedwards
Microsoft
CloudMe In Regex wrap the .+ in parenthesis to assign it to a capture group. Then you can use the optional extract parameter captureGroup:
print extract("ABC (.+) DEF", 1, "ABC XXXXX DEF") - CliveWatsonFormer Employee
Would this work?
print t= "ABC XXXXX DEF" | parse t with *"ABC" theInfo "DEF"* | project theInfo