Help with a special regular expression - does not contain some string

How can I say in regex:

Any part of a line starting with a capital letter containing at least one whitespace character that does not contain a line " _ "(underscore space) and ending with the line "!!!" (without quotes)?

I'm having problems with the "not containing" part.

Here is what I still have:

[A-Z].* .*!!!

How do I change this to also indicate "Do not contain" _ "?

This does not have to be the string "_". How can I say "not containing" ANY string? For example, not containing a "dog"?

Edit: I would like the solution to be compatible with Php "preg_replace"

Edit: Examples:

Examples for "_":

Abc xyz !!! <--- Matches

, !!! < ---

_ !!! < ---

"":

!!! < --- , ( "" )

, !!! < ---

+5
7

x(?!y) x, y. , , :

[A-Z](?!%s)(.(?!%s))* (.(?!%s))*!!!

%s - .

+2

, , , . : [A-Z].* .*!!!, , _.

+1

; , , , , , .

[A-Z][^_]*[ ][^_]*!!!
0

"_", . , .

, , , , .

: Nregex

. , , . :

[A-Z](?! _ )(\w(?! _ ))* (\w(?! _ ))*!!!
0
[A-Z]([^ ]*(?! _ ) ?)*!!!

: . :

[A-Z][^ ]* (?!_ )((?! _ ).)*!!!
0

grep -v ( Linux / grep).

-, .

grep something <INPUT> | grep -v uninteresting

grep ( , ), Vim:

vim -c "v/i'm searching for this/d" -c "g/and don't need this/d" -c "w checkoutput" <INPUT>

( , , , , , checkoutput. .)

0

All Articles