Y
Y
yuki2020-07-09 10:42:20
Regular Expressions
yuki, 2020-07-09 10:42:20

How to set a regular expression for the first letter in a sentence?

I have a sentence
this text has two sentences. good fortune.

It is necessary through a regular expression to capture the first letter of the word this and the first letter of the word good in each sentence (it is guaranteed that the letters are lower case)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
VicTHOR, 2020-07-09
@rstJkee

/^[az]|(?<=\.\s*)[az]/gm
if the dialect does not allow, can be divided into groups
/^([a-z])|\.\s*([a-z])/gm

M
Mikhail Osher, 2020-07-09
@miraage

/(?<=^|\.)\s?([a-z])/g

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question