Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash if else regex

#!/bin/bash

if [[ "$date" =~ ^[0-9]{8}$ ]]; then
    echo "Valid date"
else
    echo "Invalid date"
fi
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #regex
ADD COMMENT
Topic
Name
4+2 =