Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/circui15/public_html/packetpros.com/index.php:4) in /home/circui15/public_html/packetpros.com/wp-content/plugins/wp-file-upload/wordpress_file_upload.php on line 2

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/circui15/public_html/packetpros.com/index.php:4) in /home/circui15/public_html/packetpros.com/wp-content/plugins/wp-file-upload/wordpress_file_upload.php on line 2

Warning: Cannot modify header information - headers already sent by (output started at /home/circui15/public_html/packetpros.com/index.php:4) in /home/circui15/public_html/packetpros.com/wp-content/plugins/read-offline/lib/phpMobi/MOBIClass/MOBI.php on line 179

Warning: Cannot modify header information - headers already sent by (output started at /home/circui15/public_html/packetpros.com/index.php:4) in /home/circui15/public_html/packetpros.com/wp-content/plugins/read-offline/lib/phpMobi/MOBIClass/MOBI.php on line 180

Warning: Cannot modify header information - headers already sent by (output started at /home/circui15/public_html/packetpros.com/index.php:4) in /home/circui15/public_html/packetpros.com/wp-content/plugins/read-offline/lib/phpMobi/MOBIClass/MOBI.php on line 181

Warning: Cannot modify header information - headers already sent by (output started at /home/circui15/public_html/packetpros.com/index.php:4) in /home/circui15/public_html/packetpros.com/wp-content/plugins/read-offline/lib/phpMobi/MOBIClass/MOBI.php on line 182

Warning: Cannot modify header information - headers already sent by (output started at /home/circui15/public_html/packetpros.com/index.php:4) in /home/circui15/public_html/packetpros.com/wp-content/plugins/read-offline/lib/phpMobi/MOBIClass/MOBI.php on line 183

Warning: Cannot modify header information - headers already sent by (output started at /home/circui15/public_html/packetpros.com/index.php:4) in /home/circui15/public_html/packetpros.com/wp-content/plugins/read-offline/lib/phpMobi/MOBIClass/MOBI.php on line 184

Warning: Cannot modify header information - headers already sent by (output started at /home/circui15/public_html/packetpros.com/index.php:4) in /home/circui15/public_html/packetpros.com/wp-content/plugins/read-offline/lib/phpMobi/MOBIClass/MOBI.php on line 185

Warning: Cannot modify header information - headers already sent by (output started at /home/circui15/public_html/packetpros.com/index.php:4) in /home/circui15/public_html/packetpros.com/wp-content/plugins/read-offline/lib/phpMobi/MOBIClass/MOBI.php on line 186
Regex helpers``BOOKMOBI<5x e  0xMOBI+h @EXTHpdColliniMiscellanousg

I need help remembering what regex's do what for me and instead of re-learning them over and over, I thought I would post the most useful ones. I do a lot of 'Search and replace' …

j'Wed, 10 Sep 2014 20:51:11 +0000p$http://packetpros.com/?p=355ePacketprosf Copyright packetpros.comRegex helpers

I need help remembering what regex’s do what for me and instead of re-learning them over and over, I thought I would post the most useful ones. I do a lot of ‘Search and replace’ with config files so these are pretty specific.

Sometimes I need to just find the interfaces. (The can easily be filtered in IOS, but I tend to run multiple regex’s in my text editor)

\interface (.*)
\switchport access vlan (.*)

 

 

 

 

 

 

Another common scenario is cleaning up access lists. For example in an ASA you get a bunch of stuff at the end. A little regex will take care of that.

( \(hitcnt\=0\)) 0x(.*)

When migrating from an old ASA to the new ASA-X, migrating the ACL’s can be a bear. One of the easiest ways to migrate is to grab the access lists that only have hit counts

show access-list | e hitcnt=0

Then take that list, use Find and enter the regex below and Replace with a blank.

\line [0-9]+ | (\(hitcnt\=.*\)) (.*) | \log (.*)

That will remove all the unnecessary areas and you will be left with just an ACL that you can copy-n-paste into the new ASA.

 

FLIS00 00 00 0800 4100 0000 00 00 00ff ff ff ff00 0100 0300 00 00 0300 00 00 01ff ff ff ffFCIS00 00 00 1400 00 00 1000 00 00 0100 00 00 0000 00 06 7800 00 00 0000 00 00 2000 00 00 0800 0100 0100 00 00 003918400778