Just another weblog

HowTo: ChangeContextValue regular expressions

Posted by onlydarksets on January 15, 2008

I came up with a regular expression that should allow full access to the path, filename, and extension when using the ChangeContextValue Action. I’m sure there is a more efficient way to do it, but this works just fine.

FindRegex: ^((.*\\)(.*)\.(.*))\z


  • $1 = E:\Recorded TV\subdir\another one\Dirty Sexy
  • $2 = E:\Recorded TV\subdir\another one\
  • $3 = Dirty Sexy Money_WJLA-DT_10_10_2007_22_00_01
  • $4 = dvr-ms

So, if you want to change the extension, the ReplaceRegex value would be:


If you want to change the path, the ReplaceRegex would be:

C:\New Path\$3.$4

I don’t suggest using this to change the filename (use the AdvancedFileRename Action instead). However, if you insist, the ReplaceRegex would be:

$2$3 (FIXED).$4

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: