Used preg

Used regular expression for that