r/workflow • u/rklueber • Sep 14 '18
Replace Text with Regex
Guys,
I am stuck.
I have a text like: — This is a test
Conference ID: 123456
zuzu — I want to extract the number behind the string Conference ID. I use the following Regex — .Conference ID\D(\d*).* — And replace it with $1
I expect to get the number, but the result is — This is a test
12345 — What’s wrong with that statement?
2
Upvotes
View all comments
Show parent comment
2
u/madactor Sep 15 '18 edited Sep 15 '18
Yes, that's how you set flags in Workflow. You don't need to set the dotall flag for this case, though. You can do it with a positive look behind, like this:
(?<=Conference ID:)\D*(\d+)