Unable to use regular expression in Katalon Studio search/replace feature


I am attempting to use regular expression with the Find/Replace feature for the first time.

I have Katalon Studio test scripts which contain many multiple instances of text such as the following.



Instead of changing them manually, I thought of using the regular expression in the Find/Replace feature. Thanks to a response in this post, I obtained the following regular expression.


I ran the following script in Katalon, and it works perfectly to replace the given string.

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable

public class Main {
    public static void main() {
        String x = "Some Thread.sleep(1000) text";
        x = x.replaceAll("Thread\\R?\\s*\\.\\s*sleep\\s*\\(\\s*\\d+\\s*\\)", "wait.Wait(driver, 1)");


However, when I input the above regular expression verbatum into the “Find” field of the Find/Replace feature, and then select Options=Regular expressions, it finds nothing in the text, even though it has many instances of Thread.sleep.

What am I doing wrong? I have search other RefExp katalon posts, but don’t see a solution.

Please take a screenshot of this action, and share it to us here. We need to see what you did exactly.

I am embarrassed to say that after attempting it a second time, it is working fine now. I think I did something wrong the first time, though now sure what.

In any case, please delete my post, or I can do it myelf.

it can happen.