1

So I'm learning about RegEx's at my coding bootcamp and we were given this problem

With JavaScript-compliant RegEx, write a RegEx formula that will match URLs containing /categories/, but not /product/. For example, the solution should match sportchek.com/categories/men/footwear and not match sportchek.ca/categories/training-shoes/product/.

No on in the class seems to understand how we would go about solving this problem and was wondering if someone might be able to point out some good documentation on RegEx. The instructors solution was lack luster at best so trying to find better explanations online.

  • https://stackoverflow.com/questions/161738/what-is-the-best-regular-expression-to-check-if-a-string-is-a-valid-url check this – CodeBug Oct 30 '20 at 04:51
  • You can literally type `javascript regex match if string contains substring but not another string` into any search engine, and it will link you to dozens of answers. Did you try that? – Marc Oct 30 '20 at 05:23

1 Answers1

0

I'm posting this because it's the best resource IMO: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions

This is not a trolling attempt - that page is excellent <3

Also - congrats on starting the most rewarding career in the world.

Do. Not. Give. Up.

The Dembinski
  • 1,469
  • 1
  • 15
  • 24