c# - How can you match words with more than one character? -
I would like to use a regular expression to match all the words with one more letter, the same four.
It should not match: ttttt, rrrrr, ggggggggggggg
This should coincide: rttttttt, words, wwwwwwwwwu
The following expression will be a move.
^ (? & Lt; first & gt; [a-zA-Z]) [a -ZA-Z] *? [ Capture some more letters (to avoid recurrence of negligence) Make sure the next character is used by FIRST using a negative attribute Capture all (due to at least one claim) remaining characters Note that searching for a different character than the first characters is sufficient because If no character is different from fi Rst is the same one all the characters.
You can shorten the expression to the following.
^ (\ w) \ w *? (?!? 1) \ W + $
This will match some more characters than [a-zA-Z].
Comments
Post a Comment