Q:

Regex to remove text between / /

line: bp(k)      "by products"    / text... /
I have this line and I need a regex to remove everything between // (not //). Any ideas?
I have tried:
line = line.replaceAll("/.*?/", "/"+"/") but it wont work
Edit: (sometimes I forget people cant read my mind :P)
I need everything to be removed between / and /. Init there can be letters,',' or '_'.
With the replacement I tried, it will leave the text as it is, no errors though

A:

.* is greedy - It's matching the closing '/' and anything else until the last '/' found in the line. Read up on regex usage, and try line = line.replaceAll("/[^/]+/", "//");

