S
S
Sergey Ilyin2020-05-18 17:37:06
Python
Sergey Ilyin, 2020-05-18 17:37:06

How to find a string that does not contain a specific set of characters?

There are several lines returned by the parser (i.e. a one-line regular expression will be needed )

: reff=menu_main I want to select only /name_of_product_group/product?reff=menu_main for this I want to search in a string and, if there is no such match, then skip such a string further (or write it to the list - it's not so important) regular expression searches for any of the characters ' /', 'f', '/' I would like /f/ as a whole , grouping the desired combination into brackets and trying to exclude it also did not give any results. I will be grateful for help.


/f/

.+[^/f/]
.+^(/f/)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aRegius, 2020-05-18
@sunsexsurf

>>> '/f/' in '/name_of_product_group/product?reff=menu_main'
False
>>> '/f/' in '/name_of_product_group/product/f/category=xxx?reff=menu_main'
True

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question