I almost got the answer here, but something is missing for me, and I hope someone here helps me.
I need a regular expression that matches all but the first letter in each word of the sentence. Then I need to replace the corresponding letters with the correct number of stars. For example, if I have the following sentence:
There is an enormous apple tree in my backyard.
I need to get this result:
T**** i* a* e******* a**** t*** i* m* b*******.
I managed to find an expression that almost does this:
(?<=(\b[A-Za-z]))([a-z]+)
Using the above sample sentence, this expression gives me:
T* i* a* e* a* t* i* m* b*.
How do I get the right number of stars?
Thank.
source
share