This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to combine the URL by Regular Expression

Hi,

I hope to combine following URL by Regular Expression.

1) https://cdn.projects.scratch.mit.edu/
2) https://scratch.mit.edu/

At this moment, I am using this Regular Expression.

^https?://([A-Za-z0-9.-]*\.)?scratch\.mit\.edu/

But I am not sure that is correct or not.

Who can help to confirm?

Thanks a lot!



This thread was automatically locked due to age.
  • Your expression looks plausible.

    I would use \. and \- to escape values that might not be taken as literals.

    Better yet, I suggest creating a website object for scratch.mit.edu, and checking the box for "include subdomains".   Then create and assign a tag to the website.   Then create an Exceptions object and enable it for sites associated with the tag.

    This allows you to avoid regular expressions.   They are very difficult to get exactly right -- permit everything intended and permit nothing unintended.

    Side note:   You cannot filter on the path portion of the URL when the site uses https and decrypt-and-scan mode is off.