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

URL Filtering RegEx

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
2 Solutions

Accepted Solutions
Bob_Zimmerman
Authority
Authority

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
Legend Legend
Legend

So the complete solution is:

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

CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist

View solution in original post

0 Kudos
11 Replies
PhoneBoy
Admin
Admin

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

0 Kudos
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
G_W_Albrecht
Legend Legend
Legend

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

CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
0 Kudos
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
G_W_Albrecht
Legend Legend
Legend

Use

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

CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
0 Kudos
rbergstrom
Explorer

I will try this. Thank you for the help!

/Rickard

0 Kudos
G_W_Albrecht
Legend Legend
Legend

And did it work as needed ?

CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
0 Kudos
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
Bob_Zimmerman
Authority
Authority

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.

G_W_Albrecht
Legend Legend
Legend

Very true !

CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
0 Kudos
G_W_Albrecht
Legend Legend
Legend

So the complete solution is:

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

CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events