bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matching string including decimal point


From: Aharon Robbins
Subject: Re: Matching string including decimal point
Date: Wed, 4 Feb 2004 18:00:57 +0200

This is not a bug. The period is a metacharacter that matches
any character.  Use /2351\.38/ to match the literal period.

See the gawk documentation which explains regular expression
matching in detail.

Arnold

> From: "Jon Aldred" <address@hidden>
> To: <address@hidden>
> Subject: Matching string including decimal point
> Date: Wed, 4 Feb 2004 15:35:22 -0000
>
> Using operating system Windows XP Professional 2002 SP1
> Gawk 3.1.0 GNUwin32 version
> Gawk 3.1.1 Cygwin version
>
> The following is a stripped down version of a large text file
> 33.47 12.92351338 1785
> 87.34 2351.386306 -1.52
>
> When I use the following gawk program, it matches both lines:
> /2351.38/{print $2}
>
> i.e., the decimal point is ignored when matching.
>
> I started with a comma separated variable file, setting FS = ",".
> However, to eliminate as many possible soucres of error as possible, I
> changed the text file to space delimited, but the problem still remained.
>
> Is this a bug
>
> Regards
>
> Jon Aldred




reply via email to

[Prev in Thread] Current Thread [Next in Thread]