update regex

regex was doing unnecesary checks
Node

Node is a linked list class