I have a string as below.
$Trap:com.oss.Event(description matches "abc")
In the above string the generic portions is $Trap:com.oss.Event(<Any string>).
when i encounter the above string i need to replace with the below string.
$Trap:com.oss.Event(description matches "abc") from entry-point "EventStream".
To achieve the above i am using the following logic in java.
String stmt= $Trap:com.oss.Event(description matches "abc")
if(stmt.matches(".*\\.Event(.*).*")&& s.equals(""))
{
stmt+=" from entry-point "+"ABCStream";
}
But the above logic is not working as expected when the string is as below.
stmt="$Trap:com.oss.Event(description matches "abc") or $Trap:com.oss.Event(description matches "cde");
I need to generate the following corresponding string using regular expression.
$Trap:com.oss.Event(description matches "abc") from entry-point "ABCStream" or $Trap:com.oss.Event(description matches "cde") from entry-point "ABCStream"
Please provide some pointers to achieve the same.