Regular Expressions 101

Community Patterns

Community Library Entry

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 - 7 years ago