Forum Discussion
zachedwards
Microsoft
Oct 11, 2019Regex assert position at beginning of string
I am trying to get the 2 matches found at the beginning of the string. According to this page, you can use \A to match beginning of the line. The re2 engine syntax also permits ^ to assert position t...
CliveWatson
Microsoft
Oct 13, 2019
How about?
print Id="<Param>a</Param><Param>b</Param><Param>c</Param><Param>d</Param><Param>e</Param>"
| extend rawExtract = extract_all(@"^<Param>([^<]*)</Param><Param>([^<]*)</Param>", dynamic([1,2]), Id)
| extend returnFirst = rawExtract[0]
- zachedwardsOct 24, 2019
Microsoft
Yes, although that works in this scenario, it doesn't answer why the ^ and \A are not honored in these regex patterns 😞