Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(^|\s*)(!?\/\/)[^\n]+\s*
/
g

Description

Sustitution of comments (one line) // Example ~ input (before) ↓↓ : // comment textplain other-text

// Other comment

Example ~ sustition (after) ↓↓: textplain other-text

Submitted by hzvvictor: https://github.com/hzvvictor - a year ago (Last modified a year ago)