DEV Community

Miss Pooja Anilkumar Patel
Miss Pooja Anilkumar Patel

Posted on

193. leetcode Solution

`

while read line; do
if [[ "$line" =~ ^((([0-9]{3}) )|[0-9]{3}-)[0-9]{3}-[0-9]{4}$ ]]; then
echo $line
fi
done < "file.txt"

`

Discussion (0)