Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
Hi there,

I am completely new with this topic. I would need help with the following regex:

From URLs like this, I would need to filter only the Urls that include the Brand "youtube"

/google+redesign/apparel/mens/quickview/
/google+redesign/shop+by+brand/youtube
/google+redesign/shop+by+brand/youtube/quickview
etc.

I tried this:
\/google+redesign\/shop+by+brand\/.*youtube but it doesnt work. :/

Also I need help with this:
"Keywords that include more than two words separated by blank spaces, eg. should not include "youtube merchandise" because it only has 2 words, but it should include "google merchandise store" or "google store mountain view" because they have more than 2 words."

So I added the filter \s{2}, which also doesnt work. I really have no clue..

Can somebody please enlighten me?

What I have tried:

\s{2}

\/google+redesign\/shop+by+brand\/.*youtube
Posted
Updated 18-Oct-20 22:15pm

1 solution

 
Share this answer
 
Comments
Stefanie Huber 19-Oct-20 5:29am    
Thank you Richard, I came across this tool, but it really is just second guessing. I would need a hint.
Richard MacCutchan 19-Oct-20 9:37am    
The + characters are control characters in regex so need to be escaped in order to find a match. So something like /shop\+by\+brand/g etc. You can try different examples on the regexr page. Just paste your URLs into the text field and create and modify the regex until you find one that works.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900