/[CSH][CSHL]+?/ doesn't work. It would incorrectly match "CL" in "---CL---", and it will never match more than two characters.
/[CSH][CSHL]*[CSH]/ works.
If there wasn't a two character minimum, we'd have to use zero-width lookaheads and/or lookbehinds.
In reply to Re^2: Regexp: How to match in middle but not the ends?
by ikegami
in thread Regexp: How to match in middle but not the ends?
by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |