Wildcard in Replace Line?
-
i got…
\\15,30,5 P=2123,52,1
and im trying to make
TIMELO=15 TIMEHIGH=30 MAXDIST=5 P=2123,52,1
and of course all the values are different, 6000 some different instances…
i tried
\\.*,.*,.*
&\\\d+,\d+,\d+
in the search line, but not sure how to do the replace…
also, i dont want to disrupt the commas in the P= line (so i cant just do a global comma replace)i could changes that
\\
to something else, if its causing a problembasically im trying to change
\\ to TIMELO=
comma 1 to TIMEHIGH=
comma 2 to MAXDIST=
keeping the values
ONLY on the \\ LINEany ideas? thanks
-
You want:
Find what:
^\\\\(\d++),(\d++),(\d++)$
Replace with:TIMELO=$1\r\nTIMEHIGH=$2\r\nMAXDIST=$3
The caret (^) indicates the beginning of a line, and the dollar ($) in find indicates the end of a line.
The backslashes (\) at the beginning of the line are doubled because backslash is an escape character; you need two to represent one.
The \d indicates a digit; following it with two plus signs (\d++) means as many digits as possible in a row, but at least one.
The parentheses indicate capture groups, which can be referenced in the replacement using $n where n is the number of the capture group, counting from 1.
\r\n is a Windows line ending.
-
AMAZING!!! thank you Coises!
how do you guys even know this stuff!? =)
-
@x-77-x said in Wildcard in Replace Line?:
how do you guys even know this stuff!?
Umm, it’s all documented in the User Manual, which is linked to from the
?
menu option in Notepad++…Look under the Searching heading, for Regular Expressions.