Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

RegEx Help Needed

I'm trying to write a regular expression to block files with the extension of .lnk, but I can't get the end of line anchor ($) to work.  So far I've come up with "\.[Ll][Nn][Kk]" and that blocks "test.lnk" but it also blocks "test.lnk.txt".  I tried "\.[Ll][Nn][Kk]$" but it doesn't work.  What am I doing wrong?

Cisco Employee

Re: RegEx Help Needed

I hope this helps. I found the following sample in the link below:

regex urllist1 ".*\.([Ee][Xx][Ee]|[Cc][Oo][Mm]|[Bb][Aa][Tt]) HTTP/1.[01]"

!--- Extensions such as .exe, .com, .bat to be captured and
!--- provided the http version being used by web browser must be either 1.0 or 1.1


Cisco Employee

Re: RegEx Help Needed


     The ASA/PIX Regex engine does not suppor the end of string anchor ($). Bug CSCsm89915 has been filed as an enhancement to get this functionality into the regex engine. Unfortunately there has been no movement on that enhancement sine 2008. If this is something that would be helpful in your production environment, please contact your account team (if applicable) so they can help drive this bug.

- Magnus

CreatePlease to create content