Regular Expressions 101

Community Patterns

1...45678...285

Sustitution of comments (one line) //

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 - 10 months ago (Last modified 10 months ago)