This piece of code
String Str = new String("${project_loc:A}/Foo.yaml;${project_loc:B}/Bar.yaml");
System.out.println(Str.replaceFirst("[$][{].*[}]/", ""));
prints
Bar.yaml
while what I am trying to achieve is:
Foo.yaml;${project_loc:B}/Bar.yaml
Why is it stopping at second closing braces i.e. }
, not at first?
What regex exp can be passed to replaceFirst()
to achieve the desired result?
FYI: I tried few things at https://regex101.com/ but couldn't find any success.