I want remove characters between /**/ from a string
example:
convert the string
"select * from food where /* id = 1 and */ food_code = 2"
to
"select * from food where food_code = 2"
I want remove characters between /**/ from a string
example:
convert the string
"select * from food where /* id = 1 and */ food_code = 2"
to
"select * from food where food_code = 2"
2
Answers
It could be done like this
Escaping ‘/’ and ‘*’.
We can use a positive lookbehind
(?<=re)
and positive lookahead(?=re)
This will capture and remove multiple /.+/
Demo here