Craig McGuff
Craig McGuff

Reputation: 3978

Regex to match line starting with +

If I have an arbitrary text (SVN diff output in this case), how do I match lines that have a first character of '+' given that + has special meaning in regex's?

Upvotes: 0

Views: 209

Answers (1)

Tom
Tom

Reputation: 3063

Here you go!

/^(\+)/

The \ character escapes the +, removing it's special meaning.

Upvotes: 2

Related Questions