Re: simple perl regex question
Re: simple perl regex question
am 20.08.2007 23:23:08 von Mirco Wahab
steve.logan@gmail.com wrote:
> disclaimer - perl and shell scripting is not my area of expertise, but
> I've been asked to help in updating a ton of DNS zone files. I've got
> my scripts down to one last issue - updating the serial numbers in the
> files.
>
> Basically, the serials are all 10 digt numbers followed by a ;
>
> I'm trying to write a regex to find 10 digits ([0-9]{10}), follwed by
> a semi-colon ([;]) and then just replace it with 2007083100;
>
> Here's where I'm at - it runs ok, but the file isn't being updated:
>
>
> perl -pi -e 's/\/([0-9]{10})([;])\//2007083100;/g' domain.com.db
>
> I think I'm close here - maybe?
Yes, hairs width (imho):
$> perl -i -pe 's/(?
Regards
M.
Re: simple perl regex question
am 20.08.2007 23:25:43 von Mirco Wahab
steve.logan@gmail.com wrote:
> Here's where I'm at - it runs ok, but the file isn't being updated:
> perl -pi -e 's/\/([0-9]{10})([;])\//2007083100;/g' domain.com.db
> I think I'm close here - maybe?
Yes, hairs width (imho). But I've seen zone files with a \s in front
of the ';' ...
$> perl -i -pe 's/(?
Regards
M.
simple perl regex question
am 20.08.2007 23:27:36 von steve.logan
disclaimer - perl and shell scripting is not my area of expertise, but
I've been asked to help in updating a ton of DNS zone files. I've got
my scripts down to one last issue - updating the serial numbers in the
files.
Basically, the serials are all 10 digt numbers followed by a ;
I'm trying to write a regex to find 10 digits ([0-9]{10}), follwed by
a semi-colon ([;]) and then just replace it with 2007083100;
Here's where I'm at - it runs ok, but the file isn't being updated:
perl -pi -e 's/\/([0-9]{10})([;])\//2007083100;/g' domain.com.db
I think I'm close here - maybe?
Re: simple perl regex question
am 21.08.2007 00:16:17 von steve.logan
Wow - I need to read up on what some of that stuff does.
Thank you - it works like a charm!!
On Aug 20, 5:25 pm, Mirco Wahab wrote:
> steve.lo...@gmail.com wrote:
> > Here's where I'm at - it runs ok, but the file isn't being updated:
> > perl -pi -e 's/\/([0-9]{10})([;])\//2007083100;/g' domain.com.db
> > I think I'm close here - maybe?
>
> Yes, hairs width (imho). But I've seen zone files with a \s in front
> of the ';' ...
>
> $> perl -i -pe 's/(?
>
> Regards
>
> M.