Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
rbergstrom
Explorer

URL Filtering RegEx

Jump to solution

Hi

I want to block a URL in application layer. I have https inspection on. 

I've made a Application/Site list with "URL's are defined as Regular Expression" and added some sites to it, but I'm struggling to figure out how I would write this URL in RegEx form:

http://lexin.nada.kth.se/lexin/#main=4;

I've tried many different ways but it still not working. Other sites working.

I looked at https://regex101.com/ and I got a match on my expressions but it is still not working.

 

Thank you

Rikard

0 Kudos
Reply
2 Solutions

Accepted Solutions
Bob_Zimmerman
Advisor

Minor note: this will only match HTTP. The site is available via HTTPS, and the expression above won't match it. If you change the opening to this:

https?:\/\/

it should match both HTTP and HTTPS.

View solution in original post

G_W_Albrecht
Champion
Champion

So the complete solution is:

https?:\/\/lexin\.nada\.kth\.se\/lexin\/\#main=4;

View solution in original post

0 Kudos
Reply
11 Replies
PhoneBoy
Admin
Admin

What version/JHF level?
What precise regexes have you tried?

0 Kudos
Reply
rbergstrom
Explorer

Hi!

we are running r80.40 take 87.

I have tried

.lexin.nada.kth.se/lexin/#main=4; 

.lexin.nada.kth.se\/lexin\/#main=4; 

.lexin.nada.kth.se/lexin/*main*4* 

.lexin.nada.kth.se/lexin/.main.4.

.lexin.nada.kth.se\/lexin\/.main.4; 

.lexin.nada.kth.se\/lexin\/*main*4; 

and so on. I think the #or the = causing the problem because this url works just fine:    .lexin.nada.kth.se/lexin/bildtema-survey.html

0 Kudos
Reply
G_W_Albrecht
Champion
Champion

Why not block entire http://lexin.nada.kth.se/ ?

0 Kudos
Reply
rbergstrom
Explorer

We want to reach all the pages on that site except 

.lexin.nada.kth.se/lexin/#main=4; and 

.lexin.nada.kth.se/lexin/bildtema-survey.html

0 Kudos
Reply
G_W_Albrecht
Champion
Champion

Use

http:\/\/lexin\.nada\.kth\.se\/lexin\/\#main=4;

0 Kudos
Reply
rbergstrom
Explorer

I will try this. Thank you for the help!

/Rickard

0 Kudos
Reply
G_W_Albrecht
Champion
Champion

And did it work as needed ?

0 Kudos
Reply
rbergstrom
Explorer

Hi, 

Sorry for the late reply, I have not had the opportunity to test until today. 

It did not work as needed. I have a block rule with this regex but I can still reach the site. See attached screenshot. Is it possible for you to try this in a lab?

I tried both http and https.

/Rickard

0 Kudos
Reply
Bob_Zimmerman
Advisor

Minor note: this will only match HTTP. The site is available via HTTPS, and the expression above won't match it. If you change the opening to this:

https?:\/\/

it should match both HTTP and HTTPS.

View solution in original post

G_W_Albrecht
Champion
Champion

Very true !

0 Kudos
Reply
G_W_Albrecht
Champion
Champion

So the complete solution is:

https?:\/\/lexin\.nada\.kth\.se\/lexin\/\#main=4;

View solution in original post

0 Kudos
Reply