blakeembrey / change-case

Convert strings between camelCase, PascalCase, Capital Case, snake_case and more
MIT License
2.25k stars 96 forks source link

number "2" appears when using splitRegexp #216

Closed jjangga0214 closed 2 years ago

jjangga0214 commented 3 years ago
camelCase('hello__world', { splitRegexp: /(__)/g }) // This returns "hello_2world"

The number "2" appears in the example above.

Is this a bug?

Thanks.

blakeembrey commented 2 years ago

It's not a bug, but I would accept documentation clearing it up. The split regexp needs two matching groups to work, selecting each side of the "split".