vb.net - Regex to find words starting with a colon -
I'm preparing a text editor with vs. 2013 Express. I have to meet words that start with a colon (:). Currently I use a regex for it. But this is not right. This is my regex - ": \ w +" It finds the word, but the way I want it is not enough. My purpose is to find the words starting with a colon (the first letter of the word is a pre-test of the colon) but there are words at the beginning of only one line (not in the middle of a sentence) and this word should be excluded It is expected to start with two colon (:: Test) that you can help me ..
< P> Use
^
to match the beginning of a line New anchor. ^: (? !!) \ S +
:(?!):
This negative lookup makes this claim That :
will be followed by any but :
^: \ w +
matches this :
and the following words are only at the start of a line.
Comments
Post a Comment