select 'word.01234' ~ E'(?x) ^ # begin-of-string word # root word [.] # dot [[:digit:]]+ # digits... $ # end-of-string ' ; -- caveat: -- the (?x) option overrides any previously determined -- options including RE flavor and case sensitivity.