From: Bruce Williams Date: 2003-05-08T16:58:25+09:00 Subject: Re: regexp assignment --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 08, 2003 at 12:02:11PM +0900, Kurt V. Hindenburg wrote: > I have a string that I want to seperate individual parts; for example=20 > in the below string I want the 196 and 21. > > I can do this using sub and then modifying the strings. Is there=20 > anyway to do this simply and easily? > Something like : \([0-9]+,'[0-9]+'\) > An array would be O.K. Well, for this particular example, the following would work... "".scan /\d+/ #=3D> [196,21] For anything more complex, however, it would be a custom job. -- Bruce Williams - bruce@codedbliss.com - http://codedbliss.com --WIyZ46R2i8wDzkSu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+ug4b+9TEBqLWMJERAmMqAJ9OB7lvFKpP44N+9Hjln8/4LIf3RgCgib2I bM+ip8dBFcI7mI0p1blh/Dc= =ztsn -----END PGP SIGNATURE----- --WIyZ46R2i8wDzkSu--