Rename: (Clarification) Insert space before a digit

I currently have this rename preset:
Type: Regular Expressions
Old Name: b([0-9])(.*)#[/b]
New Name: \1 \2\3
This inserts a space before a digit in a filename.

But, it also inserts a space in the extensions; in case of mp3 files, cr2 files, etc.
I would like to modify the preset to ignore the extension.

Thanks

I would use this slight modification:

Old Name: (.[^0-9 ])([0-9]...*)#
New Name: \1 \2

Thanks again :slight_smile:

Sorry for troubling you with petty questions..
I fiddled around with your code to modify it to insert space after a digit, but failed miserably.
Could you plz help me do that!

Or even better...
A single rename function to insert space both before and after a digit, without affecting the extension
That would be cool.. Thanks!

Old name: b(([^0-9 ])([0-9]+)|([0-9]+)([^0-9 ]))(...)#[/b]
New name: \1\3\5 \4\6\7

Oh.. Long and Neat! Thanks!

...as the actress said to the bishop. :slight_smile:

ha haa.. :smiley:
should have been "Long but Neat" :slight_smile:

I modified the expression a bit, to ignore digits adjacent to period (.), as follows:
(.)(([^0-9|. ])([0-9]+)|([0-9]+)([^0-9|. ]))(...*)#

It works for the time being.. Plz confirm if there is no flaw :wink:

Thanks!

I think you should remove the two | that you put in bold as they are not needed within the [^], although since | isn't a legal filename character they are harmless.

[^0-9|. ] means match any character that isn't a digit "0-9" or a pipe, dot or space "|. "

Oh.. okay.. beginning to learn something :slight_smile: