currently I'm working on a Regex pattern, and when asserting "$" at the end of the line, it's causing issues for it not to grab anything. When I plug it into regex101, it shows that it should be working and grabbing my sample data, however, when testing it myself I've had zero luck. So I was just curious if there was an alternative solution for declaring the end of my regex pattern. My current example pattern is below.
^\W*((?i)Test(?-i))\W*\d{2}[\-]\d{2}[\-]\d{5}$
And using a regex tester shows that it should grab the value below.
Test 99-99-32123
However when attempting to test myself, when declaring $ at the end, it doesn't select any data. When I remove the $ though, then it grabs the above test data. I would still like to declare the end though to remove the chance of it grabbing false positives. So I was just curious if anyone sees an issue with what I'm doing, or has any alternative work arounds they could provide. Thanks!