In my Java project I need to match the next text. I use WireMock to stub request. So I need to write regex to find desire requests and return stub response. In WireMock I need to write regex to intercept http requests.
Suppose I has 2 jsons:
{
"action": "Handler:GET_DICTIONARY",
"locale": "en",
"data": {"dictionary_type":"EXCHANGE_RATES_AS_DICTIONARY"}
}
and
{
"action": "Handler:GET_DICTIONARY",
"locale": "en",
"data": {"dictionary_type":"MTS"}
}
I need to select only second json by regexp. The unique text to identify second json are:
on first line: GET_DICTIONARY
AND
on third line: MTS
What is a correct regexp for this?
I try this regexp but it not help:
GET_DICTIONARY\(.*\r\n\)\{2\}.*MTS