Perhaps you should read perlre and see if a non-greedy modifier /[CSH][CSHL]+?/ helps? Or explicitly require that the last character isn't an L, /[CSH][CSHL]*[CSH]/g.
In reply to Re: Regexp: How to match in middle but not the ends?
by Fletch
in thread Regexp: How to match in middle but not the ends?
by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |