+ 1
Java regex
Hi everyone! I’m not that good with regex and I was wondering if it’s possible to capture the first letter of each sentence in a paragraph (after .|?|!). I already did it with StringBuilder and for loop with if else statement. But would love to see how it would turn out with regex. Thanks in advance!
2 odpowiedzi
+ 4
(?:^|(?:\.\s)|(?:\?\s)|(?:\!\s))(\w)
\w = any lettre
| = or
?:^ = start the sentence
?:\.\s = After . and Space
?:\!\s = After ! and Space
?:\?\s = After ? and Space
https://rubular.com/r/OfDGF1iRKa1m5j
+ 2
Thank you sm Roland Roland !