Home Ask Login Register

Developers Planet

Your answer is one click away!

Pakk February 2016

Regex add space to camelCase - but not if a trailing upperCase letter exists

So i've found this - working code sample

\\B[A-Z])", " $1"

However I don't want it to space out things like "AccountUserID" to "Account User I D" - so basically no spacing if a trailing uppercase letter exists

Can anyone show me a better approachable way - possibly using capturing groups and a negative digit identifier.



anubhava February 2016

If lookbehind is supported then you can use:


RegEx Demo

And replace it by just " "

alpha bravo February 2016

Use this pattern :


and replace with a white space

Post Status

Asked in February 2016
Viewed 2,910 times
Voted 12
Answered 2 times


Leave an answer

Quote of the day: live life