regexalteryx

Regular expression using positive lookbehind not working in Alteryx


I am trying to match a string the 2nd word after "Vores ref.:" using positive lookbehind. It works in online testers like https://regexr.com/, but my tool Alteryx dont allow quantifiers like + in a lookbehind.

"ABC This is an example Vores ref.: 23244-2234 LW782837673 Test 2324324"

(?<=Vores\sref.:\s\d+-\d+\s+)\w+ is correctly matching the LW78283767, on regexr.com but not in Alteryx.

How can I rewrite the lookahead expression by using quantifiers but still get what I want?


Solution

  • You can use a replacement approach here using

    .*?\bVores\s+ref\.:\s+\d+-\d+\s+(\w+).*
    

    Replace with $1.

    See the regex demo.

    Details: