In JMeter a response had a new line character in between. Used following regular expression as "barcode?message=(.+)(\n)(.+)" and got the the result