20-08-24 01:18 PM
I am new to using Regex and needed to replace tabs, newline and multiple spaces with 1 space. Appreciate if you can provide the express and how to do that in Blue Prism.
Thanks,
Tak
Answered! Go to Answer.
20-08-24 04:16 PM - edited 20-08-24 04:17 PM
Hi @Tak.Kwok
Please download this vbo Blue Prism Digital Exchange
I will try with this data item
As you can see we have some spaces, tab, and newline
1. Use action Get Regex Matches from VBO Regular Info Extractor and provide this inputs :
For the regex string use this one "[\t\n\r ]+"
Now generate this outputs
2. Use now action Replace RegEx Matches from VBO regular info extractor and provide this inputs :
PS : please note that the [Matched Collection] is the output of the first action
For output generate this :
Now run. Your flow should look like this :
Tell me if its ok 🙂
20-08-24 08:28 PM
You can use the one action Regex Replace in BP's Utility - Strings VBO.
With this Data Item:
(Multiple tabs between rain and in. Multiple spaces between spain and falls. Multiple new lines between falls and mainly.)
Using the following text for the Pattern parameter:
\t+|\s{2,}|\n
And a space for the Replacement Data parameter:
Will give you a output parameter data item of:
20-08-24 04:16 PM - edited 20-08-24 04:17 PM
Hi @Tak.Kwok
Please download this vbo Blue Prism Digital Exchange
I will try with this data item
As you can see we have some spaces, tab, and newline
1. Use action Get Regex Matches from VBO Regular Info Extractor and provide this inputs :
For the regex string use this one "[\t\n\r ]+"
Now generate this outputs
2. Use now action Replace RegEx Matches from VBO regular info extractor and provide this inputs :
PS : please note that the [Matched Collection] is the output of the first action
For output generate this :
Now run. Your flow should look like this :
Tell me if its ok 🙂
20-08-24 08:28 PM
You can use the one action Regex Replace in BP's Utility - Strings VBO.
With this Data Item:
(Multiple tabs between rain and in. Multiple spaces between spain and falls. Multiple new lines between falls and mainly.)
Using the following text for the Pattern parameter:
\t+|\s{2,}|\n
And a space for the Replacement Data parameter:
Will give you a output parameter data item of:
21-08-24 09:05 AM
Just to drop in and say - excellent answers @MichealCharron and @Mohamad_747! Thank you for including screenshots and strings, that's incredibly helpful of you. I'm marking both as Helpful Answers.
@Tak.Kwok - please let us know if you now have the help you need!
21-08-24 12:33 PM
Thanks. This solution works