I'm working on a project and, due to a simple but very unfortunate mistake, need to rewrite a bunch of timestamps in a file; specifically, I need to take the final part of each timestamp and divide it by 30. For example, if the file contains:
"blahblahblah[00:05:25]randomblah[01:22:13]"
then i need it to say
"bahblahblah[00:05:833]randomblah[01:22:433]"
After realizing that pure regex can't handle the probem, as it only deals with character and not numbers, a little bit of googling pointed me toward a Perl one-liner, which I am trying to modify to fit my purposes. Here's what I have so far:
perl -pi.bak -e 's/\d\d:\d\d:($1/30)!/e
However, I have a syntax error "around /30"
. Can anybody help with this, as well as elucidate how it works? I get the line-by-line stuff, but not the expression part. Thanks!