I am trying to create a regexp with replace for use in a java embedded application that will pass a URL through an on click. What I have so far is
(bi.)(.*\.)([^.]+)(.com)$ with replace set to $2$3$4
This, however, does not allow for passing to environments without the second variable. What I need is something that will say IF .*\. is prd001 THEN '' ELSE .*\. I need to negate the prd001 where it exists, but pass that portion through if it is anything else in the substitution portion.
I am very new to these concepts and if you ask what language this is for, I probably could not tell you other than our application is written in JAVA. I do know I will need escape characters later, and am confident in that portion. Just lost with the regex. Thank you for any help you can provide