Refined regular expressions to handle more scenarios