N
N
Nikita2019-07-12 18:46:55
Regular Expressions
Nikita, 2019-07-12 18:46:55

Regular expression, search. How to properly implement negation?

There is a regular expression - ^[A-z0-9]*[\_][A-z0-9].*$
It looks for lines that contain "_". But the trouble is that the separator in the line can occur several times.
Need: select the lines in which it occurs only ONCE . I don’t really understand regular expressions, but I’m learning.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stockholm Syndrome, 2019-07-12
@WoT_Seller

^[a-zA-Z0-9]*_[a-zA-Z0-9]*[^_]*$

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question