The regular expression matches everything after the space of each word.

has been writing for a long time. I don"t know how to write this rule. Ask which hero to help.
along ad. Forward; and. Together; prep. together. Along the
aloud ad. Loudly
already ad. Already
also ad. Also
although conj. Although, although
altogether ad. Total
always ad. Always; always; always one of the personal forms of
am v. be?
a.m.Universe A.M.? n. Before noon, in the morning
America * n. America

each line begins with a word, followed by a space followed by the content to be deleted. Write regular expressions and delete everything after the words.
along
aloud
already
also
although
altogether
always
am
a.m.debase A.M.
America

that"s all I"ve done in the afternoon. There are some special symbols that cannot be removed.

clipboard.png

Mar.04,2021

s.split ('') [0], take the first part of the array directly;
regular: re=/ ^ [A-z] Sequential answer / the first is a letter, followed by any number of non-space characters


\s[\D\d]*
// \s 
// [\D\d] 
// * 0
// 

VSCode Editor effect

VSCode


:


Menu