Test, validate and match regular expressions
Matches the interior characters of words, excluding the first and last character. The \B ensures matching starts inside a word, [^\s]+ greedily matches non-whitespace, and the negative lookahead (?![\W]|$) ensures the match ends before the word's last character. Useful for masking or highlighting the middle of words while preserving first/last letters.