Monday, January 20, 2014

HTTP Headers

The NetScaler poses an interesting challenge for those of us who have used and managed them. NetScalers require a deep understanding of both development and networking. One of MANY things to understand is HTTP headers especially when troubleshooting a web page/site issue. I found a very nice resource that covers the basics of HTTP headers and a bit more. They also have other great tutorials and videos so spend some time a check it out!

http://net.tutsplus.com/tutorials/other/http-headers-for-dummies/

Wednesday, January 15, 2014

Regular Expressions - regex

Today, I needed to edit a regular expresssion (regex) that is used in an if statement in BPA Automate Server. This if statement is checking if a value of a string and comparing to a list of numbers. This is used as a catch functionality to skip performing a process on any string that matches the pattern (shown below).

2|15|100|103|106|108|124|125|1400...

This pattern is used to match item numbers (think SKU) that do not need to be processed. The pattern was given to us by our end users as a requirement. I know what you're thinking, just put in exactly what you have above! The issue is that the 2, 15, 100, 103, 106, etc may match in other parts of item numbers. For example, 2 is in any number such as 12, 24, and 2007. None of the last three numbers listed were being processed even though they are not an exception because they match with the 2. I need a way to specifically match 2 and 2 only. I'll show you how below!

tl;dr Read below

BPA uses the .Net Regular Expression Engine so I used the following site for help.
http://regexhero.net/reference/


  1. I tell the regex engine that only the 2 is important.
    1. [2]
  2. I want to make sure nothing appears BEFORE the 2 so...
    1. (?<!pattern) checks that a pattern doesn't exist BEFORE the location.
    2. (?<!\w) \w is the special character for all alphanumeric characters.
    3. (?<!\w)[2]
  3. I want to make sure nothing appears AFTER the 2 as well.
    1. (?!pattern) checks that a pattern doesn't exist AFTER the location. 
    2. (?<!\w)[2](?!\w) again, \w is the special character for all alphanumeric characters.
  4. The final regex would like like this:
    1. (?<!\w)[2](?!\w)|(?<!\w)[1][5](?!\w)|100|103|106|108|124|125|1400...
    2. Based on which components need to be specific to match to.
      1. In this example it is 2 and 15.

Monday, January 6, 2014

Happy 2014!

I'm back again but this is just to say happy 2014! I look forward to sharing more trials and tribulations with you in my IT world. I am preparing myself for senior design, graduation, and a new career! It should be an exciting year with many posts.