Converting sed regex to Java regex
807589Aug 21 2008 — edited Aug 21 2008I am new to reguler expressions.I have to write a regex which will do some replacements
If the input string is something like test:17038199556@test.com;value=abcd
when I apply the regex on it,this string should be changed to test:17038199556@replaceTest.com;value=replacedABC
I am trying to replace test.com and abcd with the values i have supplied...
The regex I have come up with is in sed
s/\(^.*@\)\(.*\)$/\1replaceTest.com;value=replacedABC/i
Now I am trying to get the regex in Java,I would think it will be something like (^.*@\)(.*\)$\1replaceTest.com;value=replacedABC
But not sure How i can test this.Any idea on how to make sure my java regex is valid and does the required replacements?