Author Topic: Regex replace syntax for replace with wildcard  (Read 7198 times)

JimmieC

  • Senior Community Member
  • Posts: 490
  • Hero Points: 17
Regex replace syntax for replace with wildcard
« 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.



Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: Regex replace syntax for replace with wildcard
« Reply #1 on: October 13, 2016, 12:51:08 AM »
That should work. Make sure you turn on regular expressions