vampiredom
4th October 2008, 03:18
Hi neuron2 (et al),
As I alluded to in another thread, I'm working on a Perl shell script for automating conversions via DGIndex. I took your advice and looked at the getbit.cpp file to see how the audio files were being names. I tried to break this down into REGEX-land. Perhaps you could check it out to see if I've screwed up or omitted anything:
(assuming you've some familiarity with Perl's REGEX)
# AAC
/^$prefix(?: PID [a-z0-9]{3})?(?: DELAY -?\d+ms)?\.aac$/
# MPA
/^$prefix(?: (PID |T)[a-z0-9A-Z]+)? L[123] (?:2ch|mono) (?:44\.1|48|32) (?:\d{1,3}|free)(?: DELAY -?\d+ms)?\.mp[a123]$/
# AC3
/^$prefix(?: (PID |T)[a-z0-9A-Z]+) \d[_\+]\dch \d{1,3}Kbps(?: DELAY -?\d+ms)?\.ac3$/
# DTS
/^$prefix(?: (PID |T)[a-z0-9A-Z]+)(?: DELAY -?\d+ms)?\.dts$/
# PCM
/^$prefix PCM PID [a-z0-9A-Z]+(?: DELAY -?\d+ms)?\.pcm$/
# WAV
/^$prefix(?: (PID |T)[a-z0-9A-Z]+) (?:\d[_\+]\d \d{1,3}Kbps|\d+K \d+bit \d+ch)\.wav$/
As I alluded to in another thread, I'm working on a Perl shell script for automating conversions via DGIndex. I took your advice and looked at the getbit.cpp file to see how the audio files were being names. I tried to break this down into REGEX-land. Perhaps you could check it out to see if I've screwed up or omitted anything:
(assuming you've some familiarity with Perl's REGEX)
# AAC
/^$prefix(?: PID [a-z0-9]{3})?(?: DELAY -?\d+ms)?\.aac$/
# MPA
/^$prefix(?: (PID |T)[a-z0-9A-Z]+)? L[123] (?:2ch|mono) (?:44\.1|48|32) (?:\d{1,3}|free)(?: DELAY -?\d+ms)?\.mp[a123]$/
# AC3
/^$prefix(?: (PID |T)[a-z0-9A-Z]+) \d[_\+]\dch \d{1,3}Kbps(?: DELAY -?\d+ms)?\.ac3$/
# DTS
/^$prefix(?: (PID |T)[a-z0-9A-Z]+)(?: DELAY -?\d+ms)?\.dts$/
# PCM
/^$prefix PCM PID [a-z0-9A-Z]+(?: DELAY -?\d+ms)?\.pcm$/
# WAV
/^$prefix(?: (PID |T)[a-z0-9A-Z]+) (?:\d[_\+]\d \d{1,3}Kbps|\d+K \d+bit \d+ch)\.wav$/