#!/bin/bash CAPWORD="([A-Z]{1}['a-z]+)" grep -Eo -e "$CAPWORD $CAPWORD" -e "$CAPWORD [A-Z]{1} $CAPWORD"