Good question. I went to a script right away after the difficulty with the
one-liner and returned to the command line syntax problem more out of curiosity
than anything else. I'm a fan of the command line because once I get one that
works all I need is the 'history' command and an up arrow key
I tried one final time with non-capturing parentheses i.e. (?: to no avail.
This works just fine however:
perl -i -p -e '@matches = m/\d{2}\t\d{2}\t\d{2}/g; s/.*//g; print"@matches\n"'
Retrieve, delete what's left, and rewrite what's to be kept. It should now
work everytime all the time. C
> perl -i -p -e 's/^(\d{2}\t\d{2}\t\d{2})/g' This was the 1st thing that I
> tried; it doesn't work. It was initially easy but different things kept
> appearing that forced me to use > 1
statements on the command line. Negating what I want seems like it ought to be
simple.
>
>
> What have
I would like to modify a file 'in place' at the command line with regexes. The
file changes daily and is messy. Can one negate a regex itself as opposed to a
class of regular expressions? If I could remove everything but that selected
by m/\d{2}\t\d{2}\t\d{2}/g life would be better as I know