From: Quintus Date: 2010-09-10T00:01:19+09:00 Subject: Re: regex help please? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 09.09.2010 16:43, schrieb Joe Pizzanley: > pens 1234-001 > pencils 1234-002 > scissors 2345-447 You mean, like this? irb(main):001:0> str =< " pens 1234-001\n pencils 1234-002\n scissors 2345-447\n" irb(main):006:0> str.scan(/(?:\d|\-)+/) => ["1234-001", "1234-002", "2345-447"] irb(main):007:0> Vale, Marvin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyI9qUACgkQDYShvwAbcNk5QQCePtFf7AjIyMHgS1x4CGAhQ86b SV0An1lLEuELca3TVoo8pnAJkNlRGFAw =GLmf -----END PGP SIGNATURE-----