this is sample text jfhwkjefwl todo
here sample text todo
sample text todo
I want to select only the first statement "this is sample text jfhwkjefwl todo"
. I tried with different combination of [t][e][x][t].*[t][o][d][o]
and [t][e][x][t ].*[t][o][d][o]
.
can one help me will be most appreciated.
Do you mean something like this?
.*text\s+\S+\s+todo.*
Means anything optional (.*
) followed by "text" followed by at least one whitespace (\s+
) followed by at least one non-whitespace (\S+
) followed by at least one whitespace followed by "todo".
So if you want to match the whole line then your regex have to match everything you want and not only a substring.