Regex: Select all the words/strings that begins with .dot
By Gabriel Cooper •
I want to select with regex all the words that begins with .dot
for example: .myself or .I go home or .5 a clock
Can you help me?
11 Answer
The main problem with dots is that . is the regex character for 'matches anything'. You need to escape it with a backslash.
The following regex would match words that begin with a dot:
\.\w+It means that in your example .I go home only .I will be matched, since the word go does not start with a dot. If you would like to change that and extend that to the entire line, so for instance only match the second line in the following text
I go home
.I go home
I go homeyou'd need the following regex:
^\..*where .* means 'match everything'. (In that case, make sure the Notepad++ option ". matches new line" is disabled, or you'll select the rest of the entire text.)