I have a text file Inside there is text “123CAT456789”
I want to copy only the word “CAT” into a text file automatically, what should I do?
Hi @Famui_Yanisa, welcome to the Community.
Please try the following expression in the Assign activity:
extractedWord = System.Text.RegularExpressions.Regex.Match(yourfileNameText, "\bCAT\b").Value
Hope this helps,
Best Regards.
Try this
1 Like
Hi
Please try the following expression in the Assign activity:
extractedWord = System.Text.RegularExpressions.Regex.Match(yourfileNameText, "\d*CAT\d*").Value
1 Like
Another alternate approach:
outputText = System.Text.RegularExpressions.Regex.Match(yourFileText, "(?<=\d)CAT(?=\d)").Value
Hope this helps,
Best Regards.
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.