From: Eric Hodel Date: 2003-01-22T05:47:17+09:00 Subject: Re: Regular expressions --Hc9bqgA2GpWXzMYS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Daniel Carrera (dcarrera@math.umd.edu) wrote: > I'm having trouble with a simple match: >=20 > >> line > =3D> "" > >> line =3D~ /()/ > =3D> nil >=20 > Shouldn't "." match anything other than "\n"? > Can anyone see what I'm doing wrong? In addition to the \. as mentioned early, .* is greedy, so if you have: then /()/ will give $1 =3D '' You want either /(]*>)/ or /()/, the latter being non-greedy. --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --Hc9bqgA2GpWXzMYS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE+LbHOMypVHHlsnwQRAo98AJ4ju+QTGqgkdmEWwrD4wsBL148zKgCfXnpL nJIfW9reS+oBf6oRWBuEq/Y= =Ij5l -----END PGP SIGNATURE----- --Hc9bqgA2GpWXzMYS--