For extracting Order IDs that consist of 10 digits and start with an “S” from your input text using Regex in UiPath, you can use the following pattern:
S\d{9}
This pattern ensures that the Order ID starts with the letter ‘S’ followed by exactly 9 digits, making a total of 10 characters.
To integrate this in your UiPath workflow for extracting Order IDs from a given input string, follow these steps:
Assign Activity: Place the input string (e.g., data from a file) into a variable. Matches Activity: Use the Matches activity to apply the Regex pattern S\d{9} to the input string. For Each Activity: Iterate through the matches to process the extracted Order IDs.
Here is a sample implementation in UiPath:
Input: inputText
Pattern: S\d{9}
For Each Activity:
Type argument: System.Text.RegularExpressions.Match
Values: The output of the Matches activity
Body: Add logic to process each match.Value.
This should yield the expected output:
S123456789
S153375999
S153375000
By using S\d{9}, you have a precise and efficient way to ensure the Order IDs meet your specified format requirement.
LLM helped me to write this but it’s validated by me.