more robust regex