Regular Express - Pattern matching

How to include everything after /blog but shouldn't include words like wp-content and wp-includes?

Currently showing all using regex:


I tried this but no luck:


Urls: (should include) (should include) (shouldn't include) (shouldn't include) 


Your first regex


Means a string, starting with /blog that has zero or more forward slashes after that. I'm guessing you meant just




As for how to exclude those two words:


The idea is to advance one character at a time (.), checking that wp-content or wp-includes doesn't follow after that using negative lookahead ((?!)) til the end of the string ($).

If you want to ensure the slash after blog is there without repeating the regex, you can put the negative lookahead first and then start matching characters:


This first ensures that there is no wp-content or wp-includes after any amout of characters (.*) and then continues matching.

you can use negative lookahead like this:


if the semantics of the match is "inside a url", then you most likely only want to match non-whitespace characters:


and if there are more than the 2 "wp-" examples:


..not using ^ because your examples do not match at the beginning of the string

Need Your Help

Xcode UI tests - Lost connection to test manager service

ios xcode swift xcode-ui-testing

Sometimes while running my UI tests, I get the following error Lost connection to test manager services. No logs or anything. Happens randomly. I would provide more information but I just don't hav...

Chrome block requests


I am facing unusual issue in Chrome. it is blocking a few requests and returns following: