I heard that perl is a good language when creating a regex, but I'm a little confused about characters requiring escaping
I checked the code http://regexlib.com/RETester.aspx and got the result I want
//home/dev/abc/code/hello/world.cpp#1 //home/dev/((.*?)/[^/]+).*
However, I'm not quite sure how to translate this to perl code
I tried,
\/\/home\/dev\/\(\(\.\*\?\)\/\[\^\/\]\+\)\.\*\
and
\/\/home\/dev\/((.*?)\/[^\/]+).*\
and both refused
Don't you think the escape code makes the regex very unreadable? Am I using something wrong?
source share