Regular Expressions 101

Community Patterns

JS comments

0

Regular Expression
PCRE (PHP <7.3)

/
(\r|\n){2,}((\s*\/\*\s*\W*\w.+\s*\*\/\s*)|(\s*\/\/\s*\W*\w.+\s*))(\r|\n){2,}
/
g

Description

Match all JS comments which are having >=2 Carriage return(\r) or Line feed(\n) at start and end.

Submitted by kaalavan - 6 years ago