add method for getting matched text

Hello