Test, validate and match regular expressions
Matches an entire string while capturing its content with leading and trailing whitespace removed, effectively trimming it. The leading [\s]* consumes initial whitespace, the lazy (.*?) captures the core content, and the trailing [\s]*$ consumes remaining whitespace up to the end. Commonly used to normalize user input, clean padded text, or extract trimmed values into capture group 1—a regex alternative to String.prototype.trim().