SlickEdit Community

General => General Programming => Topic started by: JimmieC on October 12, 2016, 02:31:50 pm

Title: Regex replace syntax for replace with wildcard
Post by: JimmieC on October 12, 2016, 02:31:50 pm
How can I replace the following text? Basically, I want to move .. 00 00 21(to end of line) to the start of a new line.

10/11/2016 18:04:37.370 [RX] - FD 00 00 21 1E 00 FD 00 23 20 
10/11/2016 18:04:37.370 [RX] - 30 00 00 21 1E 00 FD 00 23 20 
10/11/2016 18:04:37.370 [RX] - 80 00 00 21 1E 00 FD 00 23 20 

Using recorded a macro:
Ctrl-F11
search for " .. 00 00 21" (leading space)
Go in front of .. with cursor
Hit return
Ctrl-F11
Then hold down Ctrl-F12 until the string is no longer found (thanks for stopping macros on fail case now!)

However, some of these files are very long so Replace will be faster. I would like to do something with replace like:

Find " .. 00 00 21" (leading space)
Replace "\R.. 00 00 21" -- But, of course, the dot-dot will not work here.


Title: Re: Regex replace syntax for replace with wildcard
Post by: Clark on October 13, 2016, 12:51:08 am
That should work. Make sure you turn on regular expressions