Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
([^\s\-_A-Z]+)|([A-Z]+[^\s\-_A-Z]*)
/
g

Description

This regex is intented to match all words in a given string, remove all case separators. It match strings written in PascalCase, camelCase, kebab-case or snake_case.

Submitted by Florent Catiau-Tristant - 3 years ago