-1

What is regular expression to match exact String with underscore. ex TEST_SECRET I tried ^TEST_SECRET$ but did not work

VKR
  • 101
  • 9
  • Above link is not answer for my question. I am not using java. looking for a regex to match exactly TEST_SECRET – VKR May 19 '22 at 14:19
  • Is `TEST_SECRET` the only string on the line? Could you add some example lines from that data your trying to match TEST_SECRET in? The regular expression you provided matches a line that contain only TEST_SECRET. While if you remove `^` and `$` it would match any TEST_SECRET in the line for example `abcTEST_SECRETxyz` would match without `^` and `$`. – Inciarte May 19 '22 at 14:54

0 Answers0