A191919
A191919

Reputation: 3442

Regex exclude letter

I have regex pattern (^\w+\W\w+) which parse string such like:

in-package :presenter-domain
test-re :type string :display ""
name-de :type string :display ""

How to exclude variants when word starting with letter i.

I tried something like [^i] but it does not work.

Upvotes: 0

Views: 114

Answers (1)

Keith Hall
Keith Hall

Reputation: 16055

You need to use a negative lookahead:

(?!i)(^\w+\W\w+)

Demo

Upvotes: 1

Related Questions