@JEFerris-99999 said in search-and-replace NOOB question - CR and (any number):
Note - I know it needs to be Extended Search Mode.
This is the first part of the problem. If you want to match “any number”, then Extended Search Mode isn’t sufficient: you need to use Regular Expression mode, not Extended Search Mode.
= (carriage return or line feed)(any number)(any number)(colon)(any number)(any number)(carriage return or line feed)
and Replace:
= (space)
should be really simple, but the online User Manual - well, I have not been able to find any descriptors that fit, nor any examples close to my needs.
Searching > Regular Expression > Character Escape Sequences: \d matches any digit (0-9), which is what I am interpreting your “any number” to mean
Searching > Regular Expression > Special Control Escapes: \R matches a newline sequence in a FIND WHAT, whether you are in Windows (CRLF), Unix/Linux (LF), or ancient Mac (CR) line-ending mode; it will match the whole newline sequence, not just one byte from it, to make sure that your replacement works as you expect it to. (In practice, it essentially matches \r\n|\r|\n, though technically it matches (?>\r\n|\n|\x0B|\f|\r|\x85|\x{2028}|\x{2029}) )
I am assuming that the = you show was you saying “my expression equals…” rather than meaning a literal = sign before the newline. If so, then FIND WHAT = \R\d\d:\d\d\R would match carriage return or line feed, any digit, any digit, colon, any digit, any digit, carriage return or line feed .
For the replacement, just type the space character (or, if you want to be fancy, use \x20 to reference ASCII hex20 = decimal32 = space character)
Putting it all together:
FIND WHAT = \R\d\d:\d\d\R
REPLACE WITH = \x20 (or just a space, but I cannot show a space character in the red text
SEARCH MODE = Regular Expression
Unfortunately, nothing I have tried works as I desired, and I’m not sure why. Could you please help me understand what went wrong and help me find the solution?
“Extended” is the wrong mode to be able to do generic digits rather than just specific numbers
If you just matched the LF of the CRLF sequence, and replaced that with a space, then you would still keep the CR, which Notepad++ would still display as a newline. Turning on
View > Show Symbol > Show End of Line and
Show Space and Tab would help you see exactly what’s happening with the end of line characters and spaces/tabs, where a carriage return \r shows up as CR in a black box, line feed \n as LF in a black box, and the space will be a mid-dot and the tab a right-arrow.