A Regular Expression to match two characters surrounding a single space, with support for enforcing a minimum and maximum number of characters (2-5 characters in this regex).
/([a-zA-Z]\s){2,5}/
Matches:
- a b c d e c d e
- a b
- regexpattern
Non-matches:
- regex pattern
- regexpattern com
See Also:
- Regex To Match Spaces And Empty Lines That Aren’t In Quotes
- Regular Expression To Match Whitespace
- Regular Expression To Match All Blank Lines In Document
- Regex To Match Any Word In A String Excluding Spaces
- Regular Expressions For New Line
- Regex To Match Words With No Digits