/news/article-title.html
is not being caught by the regex:
^/news/[^(archives)].+.html
?
I'm trying to have articles that do NOT have "archives" in the filename, but start with "/news/"
Thanks!
You should use a negative lookahead. Character classes only work for a single character. Also, don't forget to escape the dot.
If "archives" cannot be at the beginning:
^/news/(?!archives).+\.html
If "archives" cannot anywhere:
^/news/((?!archives).)+\.html
More tips:
archives as a whole word: (?!archives\b).+ or (?!archives-).+\.html is at the end (it may appear more than once): \.html(?=$|[?&])
[]defines one character from a character class.[^(archives)]translates to "one character that is not one of these:archives()".