in reply to checking for pattern match with in a small chunk of data
who is stopping you to do so?you are using substr ,so keep the result in a variable and match that variable.