D
D
Denis Bukreev2018-08-15 16:16:15
Regular Expressions
Denis Bukreev, 2018-08-15 16:16:15

How to write a RegExp to capture all letters but exclude some words?

Broke my whole head.
The regular is needed for the route, before that it was like this: [-a-z]+- just capture any text with hyphens
Now we need to be able to exclude some words, for example, create.
I googled this thing: ^(?>(?!create).)*$, but I can't figure out how to connect it with the first option.
Help, please, who knows how to play regular games

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2018-08-15
@denisbookreev

^(?>(?!create).)[-a-z]+$

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question