How to replace a sub-string, say words that start with capital letters, with the length of that sub-string, perhaps using regex.
For example:
Using the regex "\b[A-Z]+[a-z]*\b"
"He got to go to New York"
Should be transformed into this:
"2 got to go to 3 4"
The actual scenario that I am using this in is a bit different, but I thought that scenario is more clear.