I have a list of files that have long strings of zeroes in them:
ch00000000000001-190320-085957-092959-12p00001000000400.264
ch00000000000001-190320-085957-092959-12p00001000000400.avi
ch00000000000001-190515-125957-132958-12p00001000000400.264
ch00000000000001-190515-125957-132958-12p00001000000400.avi
ch00000000000001-190515-185957-192959-12p00001000000400.264
ch00000000000001-190520-095956-102958-12p00001000000400.264
ch00000000000001-190520-095956-102958-12p00001000000400.avi
ch00000000000001-190520-102956-105958-12p00001000000400.264
ch00000000000001-190520-102956-105958-12p00001000000400.avi
ch00000000000002-190812-163030-170032-12p00001000000400.264
ch00000000000002-190812-163030-170032-12p00001000000400.avi
ch01-190320-075957-082959-12p00001000000400.264
ch01-190320-075957-082959-12p00001000000400.avi
ch01-190320-082957-085959-12p00001000000400.264
ch01-190320-082957-085959-12p00001000000400.avi
filelist.txt
I don't want a long string of zeroes when only 1 will do, so I want to replace a string of zeroes with only one.
In NPP, this is simple
- Code: Select all
Match: 0+
Replace: 0
This results in the following:
ch01-190320-085957-092959-12p01040.264
ch01-190320-085957-092959-12p01040.avi
ch01-190515-125957-132958-12p01040.264
ch01-190515-125957-132958-12p01040.avi
ch01-190515-185957-192959-12p01040.264
ch01-190520-095956-102958-12p01040.264
ch01-190520-095956-102958-12p01040.avi
ch01-190520-102956-105958-12p01040.264
ch01-190520-102956-105958-12p01040.avi
ch02-190812-163030-17032-12p01040.264
ch02-190812-163030-17032-12p01040.avi
ch01-190320-075957-082959-12p01040.264
ch01-190320-075957-082959-12p01040.avi
ch01-190320-082957-085959-12p01040.264
ch01-190320-082957-085959-12p01040.avi
filelist.txt
This is exactly what I want.
However, if I use the same RegEx in BRU I get:
0.264
0.avi
0.264
0.avi
0.264
0.264
0.avi
0.264
0.avi
0.264
0.avi
0.264
0.avi
0.264
0.avi
filelist.txt
which I most decidely do not want.
To achieve this result in NPP, I would have to do this:
- Code: Select all
Match: .*?0\.
Replace: 0\.
So far I haven't hit on the magic combination in BRU to achieve what I want (but I'm sure I will get it eventually).
My questions are:
- A. What is the correct BRU RegEx (in case someone answers this before I figure it out)?
But most importantly
B. Where do I find documentation on the RegEx language for BRU?
C. Why is there a difference between the two?
Just in case anyone is interested, this is my bible for RegEx in NPP,
https://letconex.blogspot.com/2013/06/how-to-use-regular-expressions-in.html
but, obviously it has limited use in BRU.