Test Regular Experssion from ASA CLI

If you happen to be creating regular expressions for use with inspections, they can get a bit confusing, and you should test regular expressions that are to be placed in to a production environment. The ASA provides a convenient command to test regular expressions, below is a test of a regular expression used to match .mp3 (and all variants).

FW#test regexp "new.mp3" "\.[Mm][Pp]3
INFO: Regular expression match succeeded.

Next, I will test the regular expression against a string I know will fail.

FW#test regexp "new.wav" "\.[Mm][Pp]3"
INFO: Regular expression match failed.

This is a quick way you can test the regular expressions you plan to use with inspection maps, without breaking out some third-party tool, or commercial software.

Aug 11th, 2011 • Posted in ASA
No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>