make sure you are using the correct type of regular expressions
ereg is different syntax than preg so make sure the examples you are learning from are the right type
keep in mind that '.' is a special character meaning "match any single character"
you must escape some characters
. matches a single period
{3} means to match only 3 of something
{,3} means the same as {0,3} : match up to three
{1,3} is probably what you want, from one to three characters
() groups things together
? means 0 or 1, which means
:[0-9]{5} must include a 5 digit port
and
(:[0-9]{1,5})? may include the group of chars that represent a port of up to 5 digits
regex is hard to learn in the first place.. but once you wrap your head around it do you will find it very very useful