Error while parsing regular expression


#1

I want to extract specific part of folder path and apply it as genre.

Example:

D:\Music\Psybient\Albums\Shpongle\2005 - Nothing Lasts But Nothing Is Lost

D:\Music\Psytrance, Goa\Compilations\1999\Psionic Sounds

Notice the genre? All right.

Why doesn't this work?

$regexp(%_folderpath%,D:\\\\Music\\\\([\w ,]+)(\\\\)(.*),$1)

I get this error:

Invalid preceding regular expression prior to repetition operator. The error occured while parsing the regular expression fragment '\Music(+HERE)()(.)'..mp3


#2

put the expression in single quotes if it contains chars like [ , that have special functions from the scripting language:

$regexp(%_folderpath%,'D:\\Music\\([\w ,]+)(\\)(.*)',$1)


#3

You can simplify that a little, too

$regexp(%_folderpath%,'D:\\Music\\([^\\]+)\\.*',$1)


#4

Thanks and thanks!