Implementing better regexp