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

On Mon, Jul 25, 2011 at 12:11:03AM +0900, Gregory Ma wrote:
> Hi,
> 
> I need help with a Regular Expression, I need to split the text on "- "
> on get the first element.
> 
> "Web Application / QA Developer (Mid-Senior Level) - BFG Interactive -
> (Hilton Head Island, SC) - FullTime"
> 
> I tried this, but it doesn't work: /(.*) - /i

I don't know what code you're actually using with this regex.  As already
mentioned in other email responses (one of them from me), you might want
to try using the split method with an explicit string rather than a
regex.  If you want to use a substitution regex, though, you might do
something like this:

    >> foo = 'I want this - not that - nor that.'
    => "I want this - not that - nor that."
    >> foo.sub(/ - .*/, '')
    => "I want this"

-- 
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAk4sRVYACgkQ9mn/Pj01uKVgmQCggcSB3p0Lmz3CATGgHO1OEU6d
37IAoJ3UlXUARPlMBn+gmcQTxgE5enBo
o4
-----END PGP SIGNATURE-----

--l76fUT7nc3MelDdI--