I am trying to use this regex (JS):
/\/\*(.*)\*\//g
To replace
/*
sdandsads
*/
with nothing.
But it is not working! Why? o_O
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
the dot catches everything except newlines..( if the dotall is false )
so either use the dotall ( as mentioned in other answers/comments this is not supported in javascript, but i will leave it here for reference )
or add the whitespace chars
\sin your expressionsAlan mentioned in his comment a bad performance from the answer i gave so use the following instead.. ( which translates to everything whitespace and everything non whitespace, so everything.. )