Small bug in Help fileMatch

Would you like Bulk Rename Utility to offer new functionality? Post your comments here!

Small bug in Help fileMatch

Postby chrisjj » Thu Jul 10, 2025 3:19 pm

rawDate = fileMatch('^Date:\s*.*', 'i');


'\s" is nonsense here, and presumably that should read:

Code: Select all
rawDate = fileMatch('^Date:\\s*.*','i');


though it doesn't cause a fail.

And better:

Code: Select all
rawDate = fileMatch('^Date:.*',    'i');


or indeed (as per RFC):

Code: Select all
rawDate = fileMatch('^Date:.*');
chrisjj
 
Posts: 58
Joined: Wed Mar 30, 2011 5:26 pm

Re: Small bug in Help fileMatch

Postby Admin » Fri Jul 11, 2025 2:05 am

Hi, \s is meant to match all spaces after : and before date starts (just in case there are more than one).
Admin
Site Admin
 
Posts: 2990
Joined: Tue Mar 08, 2005 8:39 pm

Re: Small bug in Help fileMatch

Postby chrisjj » Fri Jul 11, 2025 11:02 am

Admin wrote:Hi, \s is meant to match all spaces after : and before date starts (just in case there are more than one).


But it doesn't. It matches any s after : and before date.
chrisjj
 
Posts: 58
Joined: Wed Mar 30, 2011 5:26 pm

Re: Small bug in Help fileMatch

Postby Admin » Sun Jul 13, 2025 9:53 am

Yes, it should be \\s (escaped). I have logged this one to be fixed. Thank you for reporting this.
Admin
Site Admin
 
Posts: 2990
Joined: Tue Mar 08, 2005 8:39 pm

Re: Small bug in Help fileMatch

Postby chrisjj » Sun Jul 13, 2025 11:08 am

Admin wrote:Yes, it should be \\s (escaped). I have logged this one to be fixed.


Great. But note that actually the \\s is redundant - given it is followed by .* . So as I said, better would be:

rawDate = fileMatch('^Date:.*');

whcih also removed the case insensitivity, respecting the fact that Date is case-significant/
chrisjj
 
Posts: 58
Joined: Wed Mar 30, 2011 5:26 pm

Re: Small bug in Help fileMatch

Postby Admin » Sun Jul 13, 2025 11:55 am

Yes, the \s is not really needed for the match since it's zero or more spaces...
Admin
Site Admin
 
Posts: 2990
Joined: Tue Mar 08, 2005 8:39 pm


Return to Suggestions


cron