Please help for RegEx query
-
I have this problem with RegEX:
Example:
Das ist richTig. ISt das ein TeXt. Ja, dAS ist in OrDnung.If I make this:
(?-is).+
\L$0= das ist richtig. ist das ein text. ja, das ist in ordnung.
The first letter must be ignored, that would be correct:
Das ist richtig. Ist das ein Text. Ja, das ist in Ordnung.I hope for a help. Big thanks!
-
You may try this:
Search for:(\<.)(\w*)((?:\s|[[:punct:]])*)
Replace with:$1\L$2$3Then hit “Replace all”
Teardown:
(\<.)Selects the first Character following a word beginning and makes it group$1
(\w*)Selects all following word characters and makes it group$2
((?:\s|[[:punct:]])*)Selects all following space or punctuation characters and makes it group$3Replace by Group
$1as is followed by group$2converted to lowercase followed by group$3as is. Repeat for all subsequent words. -
Wonderful. That’s what I’ve done.
Big thanks again! -
Hello, @tzrtnlutz, @gerdb42 and All,
After some tests, I think that the regex may even be shortened :
SEARCH
(\w)(\w*)REPLACE
$1\L$2
Indeed, the unique ASCII character ( so, <
\x{0080}), which is, either, a word character and a punctuation character is the Low Line symbol _ (\x{005F}). But, as the regex\w*will catch the greatest amount of word characters, it will include all possible_symbols, anyway ! Thus, the punctuation character, after a word, will be, necessarily, a character different from_:-))Moreover, as the
\wand\ssets of characters have no common element, neither, the ending part(?:\s|[[:punct:]])*is useless !Cheers,
guy038
-
As you know, I’m not much for shortening already published and working regexes here, but in this case I think it is worthwhile as it makes what is being done much clearer.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login