0

We have around 300 regular expressions that are around 150-200 characters long. Frequently around 20 among these expressions are revised by users based their requirement and often they have syntax errors. It is time consuming for developers to validate each of updated expression on https://regex101.com/ website.

Is there any way to programmatically validate them all of them in C# code or in SQL? I have all of these expressions saved in sql-server database.

jaczjill
  • 334
  • 9
  • 25
  • 1
    If it is about detecting syntax errors, just instantiating a Regex object with the regex pattern(s) in question should be sufficient -- it will throw an exception in case of a pattern with syntax errors... –  Sep 06 '18 at 20:33
  • 1
    Have you ever validated how long and the amount of memory your parsing algorithm takes. Doesn't seem very efficient. – jdweng Sep 06 '18 at 20:43
  • @KevinAvignon Regex Storm looks like regex101. We have regular expresssions ready with us, looking for the way of validating them all once programmatically. – jaczjill Sep 06 '18 at 20:44
  • 1
    You need some sort of unit testing and code commit processes in place so that people can't just "revise" something business critical – Sayse Sep 06 '18 at 20:44
  • Thanks @elgonzo & BACON, this will do the magic! – jaczjill Sep 06 '18 at 20:47

0 Answers0