How to use regular expression in katalon

i have used gettext to capture some data in a variable. So lets say the value in varaible = USD 45,000.00
how can i use substring or reg ex to chop the currency type and only take 45,000.00,which i want to compare to another number with Verify MAtch.

Another other solutions also well come. :slight_smile:

Your regex should be like this: [^a-z ]([.0-9])\d (

WebUI.verifyMatch(yourText', '[^a-z ]*([.0-9])*\d')

Hi if there is a msg with text and number how to match that-

“A test number t123 has generated” is not matching with regex - “A test number t*[0-9]*\d has generated”

Any solution for the above??

The following should match your text:

WebUI.verifyMatch(WebUI.getText(TO), “A test number t\\d{3,5} has generated”, true)

In the above, I use the lowercase d to indicate digits and the curly brackets to indicate the number of digits, in this case, between 3 and 5.

When I try to match on Client names, I use “Surname, \\D{3,15}” (I know the Surname, but the unknown is the Client’s Given Name). In this case, I use the uppercase D–I am only looking for letters. What this RegEx expression finds are data entry errors such as tabs or other unprintable characters (so this is a weak spot if you needed that too, but then you could go with .* (dot + asterisk).