cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1014
Views
0
Helpful
1
Replies

ASA RegEx Match

peter.kersting
Level 1
Level 1

Hi All,

I've configured a FTP inspect policy-map, within the policy map I'm using the match filename command to identify certain files

regex test ^cisco.*

policy-map type inspect ftp FTP_PMAP

match filename regex test

   reset

The problem I have is that the regex above does not work but the regex below does.

regex test2 cisco.*

filenames are in the format cisco1.txt, cisco2.txt etc....

Any ideas?  the ASA is running version 8.2(2)

1 Reply 1

Marcin Latosiewicz
Cisco Employee
Cisco Employee

Peter,

Did a short test.

^cisco.* should match anything begining with "cisco" followed by any number of characters.

--------------

ciscoasa# test regex cisco2.txt ^cisco.* 
INFO: Regular expression match succeeded.
ciscoasa# test regex 1_cisco2.txt ^cisco.*
INFO: Regular expression match failed.

---------------

If you want to match the ciscoX.txt files

-------

ciscoasa# test regex cisco2.txt cisco[0-9]\.txt
INFO: Regular expression match succeeded.
-------

Theory is regexps in test and in policy maps should be working same way ... provided no extra characters are added.

Review Cisco Networking for a $25 gift card