Sep 28 2019
05:59 AM
- last edited on
Apr 08 2022
10:08 AM
by
TechCommunityAP
Sep 28 2019
05:59 AM
- last edited on
Apr 08 2022
10:08 AM
by
TechCommunityAP
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"
Sep 28 2019 10:42 AM
Solution
Would this work?
print t= "ABC XXXXX DEF"
| parse t with *"ABC" theInfo "DEF"*
| project theInfo
Oct 11 2019 02:40 PM
@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")
Sep 28 2019 10:42 AM
Solution
Would this work?
print t= "ABC XXXXX DEF"
| parse t with *"ABC" theInfo "DEF"*
| project theInfo