01234 s = 1FA7 big-endian x = 1F A7 0 1 x = A7 1F little-endian <- basic regex c matches itself if not special \ escape \\ matches single \ \c matches literal c if c is special . matches any single char c* matches 0 or more c [ ] set ^ matches beginning of line $ matches end of line \( \) tag \1 \2 ... back reference extended regex | or ( ) group --- palindromes: $ ln -s /usr/share/dict/words . $ grep '....................' words | head abdominohysterectomy acetylcholinesterase acetylmethylcarbinol acetylphenylhydrazine adrenocorticosteroid adrenocorticotrophic adrenocorticotrophin aerobacteriologically alkylbenzenesulfonate alkylbenzenesulfonates $ grep '^\(.\).\1$' words | head AAA aaa ABA aba ADA AEA AFA aga AHA aha $ grep '^\(.\)\(.\).\2\1$' words | head addda ajaja alala alula anana arara CAMAC civic deked deled $ grep '^\(.\)\(.\)\(.\)\3\2\1$' words | head AAAAAA degged denned hallah kakkak mallam marram pullup redder renner $ grep '^\(.\)\(.\)\(.\).\3\2\1$' words | head deedeed deified hagigah halalah murdrum ottetto peeweep pip-pip reifier repaper $