Regular Expression for Words with spaces

Problem: I want to check for the following strings using regExpression: 1) Main-xxxxx-Accepted 2) Main-xxx xxx-Accepted I used the below String regEx = 'Main-[aA-zZ-]*-Accepted'; Pattern.matches(regEx,'Main-SUBMITTED-Accepted')); results in **TRUE** It works fine for Main-SUBMITTED-Accepted. But it fails for a word with spaces (non submitted) Pattern.matches(regEx,'Main-NOT SUBMITTED-Accepted')); results in **FALSE** I tried the below ones. Nothing works String …