0 votes
1 view
in RPA by (5.3k points)

I am reading a text from an application using BluePrism. The text has the following structure (the number varies from case to case): "Please take note of your order reference: 525". I need to be able to extract the number from the text. Looking at the calculation stage, there is a replace function: replace(text, pattern, new-text). I want to use this function to replace all alphabetic characters in my text with an empty string to return only whatever is numeric. How can I input that in the pattern? So I want something like this:

Replace([Order confirmation text ], /^[A-z]+$/, " ")

Also, I tried to look for a proper documentation for the VBOs that are shipped with blueprism, but couldn't find any. Does anyone know where we can get documentations for blueprism functions?

1 Answer

0 votes
by (9.5k points)

I think you should go the replace function.

So, if the string is always in that format, then you can use:

Replace([Text],"Please take note of your order reference:","")

If the text is not always that standard, then you should rather use a regular expressions. To do that, you need to use an object, that will invoke a regex code.

In the standard blueprism objects, you can find:

Object: Utility - Strings C# Action: Extract Regex Values

this is code to implement the regex code.

Dim R as New Regex(Regex_Pattern, RegexOptions.SingleLine) Dim M as Match = R.Match(Text) replacement_result = R.Replace(Text,Regex_Pattern,replacement_string)


Welcome to Intellipaat Community. Get your technical queries answered by top developers !