Page 1 of 1

Bug|2.7.1.2] Regex input is invalid always

PostPosted: Tue Mar 13, 2012 9:41 pm
by rautamiekka
Since contacting you twice doesn't get me reply ...

Whatever I input as Regex, nothing happens in the object listing, likewise hitting Rename pops up "<number> objects processed. 0 needed modification" when it's obvious there are objects matching the expression. If BRU says anything, it's "invalid regular expression". I checked from the help that, for instance, the pipe "|" works as or operator, but it doesn't.
Code: Select all
nsrs|gem
is as useless as
Code: Select all
^[0-9]
which should be valid too.

Re: Bug|2.7.1.2] Regex input is invalid always

PostPosted: Fri Mar 30, 2012 9:08 pm
by bitmonger
It would be helpful if you would give examples of what you are trying to do.
I tried to test the expressions you gave and they worked fine.
I created 2 txt files and used nsrs in one name and gem in the other.

New nsrsText Document.txt
New Text Dgemocument(2) .txt

I then put the following as a regex
(.+)(nsrs|gem)(.+)
Replace with:
\1\3
It renamed them:
New Text Document.txt
and
New Text Document (2).txt
respectively.
The ^[09] also worked.

Maybe yours was a buggy install. Give some examples and maybe we can help you out.

Re: Bug|2.7.1.2] Regex input is invalid always

PostPosted: Sat Apr 14, 2012 9:38 am
by russellii
Did you solve this as it looks similar to my problem, with regardless of what I enter in the regex match box, the regex heading shows as red.

Re: Bug|2.7.1.2] Regex input is invalid always

PostPosted: Fri Aug 03, 2012 7:59 am
by Stefan
bitmonger's example shows it:

you must put the regex to match the parts to keep into (...) parentheses
and refer to that what is matched by that regex and stored into an back reference group
by \1 for the first group in the Replace field.


Example:

Don't use "nsrs|gem" only
but "(nsrs|gem)"
and in the Replace field put an "\1"

But that's not all about regex, to use the regex feature it is good
to know something about regex, so maybe read an tutorial first.
And then you can use the whole regex power in BRU the next time too.
If there are any more questions, please just ask.

Re: Bug|2.7.1.2] Regex input is invalid always

PostPosted: Fri Aug 03, 2012 8:04 am
by Stefan
russellii wrote:with regardless of what I enter in the regex match box, the regex heading shows as red.

Red color is not marking an error but just indicate that that rule is modified and active.
So you can easier spot which rule will apply to the renaming process.

Re: Bug|2.7.1.2] Regex input is invalid always

PostPosted: Tue Aug 07, 2012 7:42 pm
by soulBit
I was just about to post on the forum with this as a bug too, till I saw this post - then it hit me! I was thinking about removing something, but really you want to be thinking about what you want to keep.

E.G: I want to remove
Code: Select all
[Bleachverse]_

from
Code: Select all
[Bleachverse]_BLEACH_275.avi


The regex you want is not just
Code: Select all
\[Bleachverse\]

but
Code: Select all
\[Bleachverse\]_(.*)

with
Code: Select all
\1

in the "replace" field.

Re: Bug|2.7.1.2] Regex input is invalid always

PostPosted: Wed Aug 08, 2012 6:16 pm
by rautamiekka
Stefan wrote:Don't use "nsrs|gem" only
but "(nsrs|gem)"
By my sense that shouldn't make any difference, since the pattern is just 2 chars longer with the brackets, starting/ending before/after them.
---------------------
soulBit wrote:I was just about to post on the forum with this as a bug too, till I saw this post - then it hit me! I was thinking about removing something, but really you want to be thinking about what you want to keep.

E.G: I want to remove
Code: Select all
[Bleachverse]_

from
Code: Select all
[Bleachverse]_BLEACH_275.avi


The regex you want is not just
Code: Select all
\[Bleachverse\]

but
Code: Select all
\[Bleachverse\]_(.*)

with
Code: Select all
\1

in the "replace" field.
Well, that makes sense for some degree, but doesn't work right way ...

For testing I
1) made a "New Notepad++ Document.txt" file
2) put "(New )*" in Match field of RegEx (1) frame (without quotes)
3) put "\1" in Replace field of RegEx (1) frame (without quotes)
and the New Name column says the name would be "New .txt" (without quotes). If I switch '1' from the Replace with 2, the name would become same as what is in Replace.

Re: Bug|2.7.1.2] Regex input is invalid always

PostPosted: Sun Oct 14, 2012 3:22 pm
by rautamiekka
WinfredUlmer wrote:Yours was a buggy install. Give some examples and maybe we can help you out.
Like what ? How those I gave aren't enough ?