Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Aug 2005 10:36:53 -0700
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        Jeremie Le Hen <jeremie@le-hen.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: sed s///i
Message-ID:  <20050808173653.GA1936@odin.ac.hmc.edu>
In-Reply-To: <20050806125340.GA45385@obiwan.tataz.chchile.org>
References:  <20050806125340.GA45385@obiwan.tataz.chchile.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--tKW2IUtsqtDRztdT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Aug 06, 2005 at 02:53:40PM +0200, Jeremie Le Hen wrote:
> Hi,
>=20
> I would like to implement the 'i' flag for the 's' command in sed(1).
> This flag would mean that the match must be case insensitive.
>=20
> I'm not willing to implement this to conform to GNU sed(1), I just find
> it very handy :
>=20
> 	s/[Ff][Oo][Oo]/bar/
>=20
> would become
>=20
> 	s/foo/bar/i
>=20
> Before I start modifying the code, I would like if it is something that
> has chances to get commited or not, although SUSv3 doesn't talk about
> this flag.

I can't see any harm in implementing this.  Anyone trying to make an "i"
flag mean anything else would be taken out and shot. :)

> I also need to add that this change would be a little intrusive in the
> code.  Actually the regular expression gets compiled, then the
> substitute string and finally flags are handled.  Thus this would
> require scanning flags before compiling the regular expression.

Are there any test cases out there for sed RE handling?  If not, I'd
suggest this would be a good time to create some to help insure this
change maintains correctness.

-- Brooks

--=20
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

--tKW2IUtsqtDRztdT
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFC95giXY6L6fI4GtQRAjSrAKCs2Gw/41rZLSs9/N4erRZjuZvyQQCcCiDP
e2Glkwm3sBVlC7HErnskXtg=
=13C0
-----END PGP SIGNATURE-----

--tKW2IUtsqtDRztdT--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050808173653.GA1936>