Hi all, I've read that there are differences between the Java and
Javascript regex patterns, so you'll get different behaviour when it
dev/hosted/prod mode using regex.
I'm trying to do a split which includes the delimiter to process camel
case text. In simpler form (forgetting acronyms and such):
String regex = "(?=[A-Z])";
String[] words = camelCase.split(regex);
// go on to capitalise each word
This works in dev mode - straightforward java regex. But this doesn't
work as expected in prod mode. Then through a little trial and error
here:
http://www.pagecolumn.com/tool/regtest.htm (click the "Return"
tab to see the evaluated output)
This piece of javascript did what I wanted.
var myArray = str.split(/(?=[A-Z])/g)
So off I went and plucked "/(?=[A-Z]/g" into my
camelCase.split(regex), but it appears to be just returning the entire
string.
Test browser is FF12.