How can I regex-escape a dynamically inputted string. I would like to surround it with actual regex code and then do matching, but I need all regex-special characters from the input escaped.
You can use raw string literal
string LitString = R"(^(?:[1-9]\d*?|0)?(?:\.(?:\d*?[1-9]|0))?(?<=[\d])$)";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With