Linux: Regular Expression: grep

Signed Integers

egrep ‘^[+-]?[0-9]+$’ data.txt

Floating Point Numbers

egrep ‘^[+-]?[0-9]+[.]?[0-9]*$’ data.txt

Canadian Postal Code

egrep -q ‘^[A-Z][0-9][A-Z] *[0-9][A-Z][0-9]$’ info.txt