RegEx question
Paul Mooring
drpppr242 at gmail.com
Thu Sep 17 10:52:26 MST 2009
Thanks for the help I did get it working with this:
name = row[0].match(/^([^@]+)/).to_s
domain = row[0].match(/[^@]+$/).to_s
though I'm not sure I fully understand what the [^@] does. I know that ^
is the start of the line and + means once or more, and I thought that []
was used to match any of several characters, but it looks like something
else is going on here. Is this working just a fluke or is that the
proper wat to do it?
-----Original Message-----
From: Jared Anderson <jared at thegoldenedge.com>
Reply-to: Main PLUG discussion list
<plug-discuss at lists.plug.phoenix.az.us>
To: Main PLUG discussion list <plug-discuss at lists.plug.phoenix.az.us>
Subject: Re: RegEx question
Date: Thu, 17 Sep 2009 08:55:13 -0700
^([^@]+)@
On Thu, Sep 17, 2009 at 8:25 AM, Paul Mooring <drpppr242 at gmail.com>
wrote:
This is probably a really obvious question but how can I match
everything up to a character not including that character with
regex? For example:
person at email.tld => person
me at here.com => me
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss at lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20090917/2d97f5fd/attachment.htm
More information about the PLUG-discuss
mailing list