Sample Header Ad - 728x90

Does Bourne Shell have a regex validator?

7 votes
1 answer
1168 views
I am on a closed network (i.e. no connectivity to the internet). I have a bourne shell script that asks for the user to enter a regular expression for use with grep -P. Generally speaking, I like to do some form of input validation. Is there a way to test a string variable to see if it is a (valid) regex? (Copying things from the internet onto my system can be done, but it takes forever and is a PITA -- thus I am looking for way to do it natively.)
Asked by Scottie H (744 rep)
Mar 22, 2023, 11:12 PM
Last activity: Mar 23, 2023, 12:11 AM