List Info

Thread: New To RegEx




New To RegEx
country flaguser name
United States
2007-08-30 15:46:13
I'm new to the power of regular expressions.

I'm trying to write two expressions:

1) matches on 77
2) matches on anything but 77

For #1 two I have:
77?

The test cases for #1 are:
63 = false
null = false
whitespace = false
77177 = false
177 = false
771= false
77 = TRUE

Test cases for #2 are:
63 = true
null = true
whitespace = true
77177 = true
177 = true
771= true
77 = FALSE

Thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: New To RegEx
country flaguser name
United States
2007-08-30 15:50:10
To match 77, the regex should just be 77

To match anything but 77, this is best done in code by doing
a match
on 77 and negating match.

On Aug 30, 2:46 pm, JLL <jacob....gmail.com> wrote:
> I'm new to the power of regular expressions.
>
> I'm trying to write two expressions:
>
> 1) matches on 77
> 2) matches on anything but 77
>
> For #1 two I have:
> 77?
>
> The test cases for #1 are:
> 63 = false
> null = false
> whitespace = false
> 77177 = false
> 177 = false
> 771= false
> 77 = TRUE
>
> Test cases for #2 are:
> 63 = true
> null = true
> whitespace = true
> 77177 = true
> 177 = true
> 771= true
> 77 = FALSE
>
> Thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: New To RegEx
country flaguser name
United States
2007-08-30 15:58:29
Thanks Russ

I need to ensure the whole string is only 77.

So the string '77177' would be true if the expression was
just 77.

I need it to be false for the '77177' test case and only
true for
'77'.


On Aug 30, 1:50 pm, russ <black.russ...gmail.com> wrote:
> To match 77, the regex should just be 77
>
> To match anything but 77, this is best done in code by
doing a match
> on 77 and negating match.
>
> On Aug 30, 2:46 pm, JLL <jacob....gmail.com> wrote:
>
> > I'm new to the power of regular expressions.
>
> > I'm trying to write two expressions:
>
> > 1) matches on 77
> > 2) matches on anything but 77
>
> > For #1 two I have:
> > 77?
>
> > The test cases for #1 are:
> > 63 = false
> > null = false
> > whitespace = false
> > 77177 = false
> > 177 = false
> > 771= false
> > 77 = TRUE
>
> > Test cases for #2 are:
> > 63 = true
> > null = true
> > whitespace = true
> > 77177 = true
> > 177 = true
> > 771= true
> > 77 = FALSE
>
> > Thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: New To RegEx
country flaguser name
United States
2007-08-30 17:35:15
so you want:  ^77$
?

On Aug 30, 4:58 pm, JLL <jacob....gmail.com> wrote:
> Thanks Russ
>
> I need to ensure the whole string is only 77.
>
> So the string '77177' would be true if the expression
was just 77.
>
> I need it to be false for the '77177' test case and
only true for
> '77'.
>
> On Aug 30, 1:50 pm, russ <black.russ...gmail.com> wrote:
>
> > To match 77, the regex should just be 77
>
> > To match anything but 77, this is best done in
code by doing a match
> > on 77 and negating match.
>
> > On Aug 30, 2:46 pm, JLL <jacob....gmail.com> wrote:
>
> > > I'm new to the power of regular expressions.
>
> > > I'm trying to write two expressions:
>
> > > 1) matches on 77
> > > 2) matches on anything but 77
>
> > > For #1 two I have:
> > > 77?
>
> > > The test cases for #1 are:
> > > 63 = false
> > > null = false
> > > whitespace = false
> > > 77177 = false
> > > 177 = false
> > > 771= false
> > > 77 = TRUE
>
> > > Test cases for #2 are:
> > > 63 = true
> > > null = true
> > > whitespace = true
> > > 77177 = true
> > > 177 = true
> > > 771= true
> > > 77 = FALSE
>
> > > Thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: New To RegEx
user name
2007-08-30 19:04:18
Thanks

I see, so this says...

Starts (^) with (77) and ends ($) with 77.

Do you have a link that you find helpful on RegEx?

So would the opposite be:
[^^77$]

Thanks



On 8/30/07, nschubachgmail.com">nschubachgmail.com < nschubachgmail.com">nschubachgmail.com> wrote:

so you want: ; ^77$
?

On Aug 30, 4:58 pm, JLL < jacob....gmail.com">jacob....gmail.com> wrote:
>; Thanks Russ


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Re: New To RegEx
user name
2007-08-30 20:04:00
I recommend http://www.regular-expressions.info/

For a useful Regex tool, try http://www.regexbuddy.com

Rick



Do you have a link that you find helpful on RegEx?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Re: New To RegEx
country flaguser name
United States
2007-08-30 21:26:49
I like quickrex -- it's free
http://www.bastian-bergerhoff.com
/eclipse/features/web/QuickREx/standalone.html

On Aug 30, 7:04 pm, "Rick Quatro"
<rickqua...gmail.com> wrote:
> I recommendhttp://www.regul
ar-expressions.info/
>
> For a useful Regex tool, tryhttp://www.regexbuddy.com
>
> Rick
>
> > Do you have a link that you find helpful on
RegEx?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: New To RegEx
country flaguser name
United States
2007-08-30 22:49:13
[^^77$] is not the opposite of ^77$

[^^77$] will match any single character that is not a
caret, 7 or
dollar sign.

There's not really a negation syntax for regular
expressions.  The
[^stuff] pattern is for creating character classes that
exclude
certain characters.  As I said before, the best way to match
strings
that don't match an expression is in code.

In Java, you'd use a ! (not) operator, like this:

!string.matches("^77$")

In Perl you'd use the !~ operator, like this:

string !~ /^77$/

What language are you using?

On Aug 30, 6:04 pm, "Jacob LL" <jacob....gmail.com> wrote:
>
> So would the opposite be:
> [^^77$]
>
> On 8/30/07, nschub...gmail.com <nschub...gmail.com> wrote:
>
> > so you want:  ^77$
> > ?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: New To RegEx
country flaguser name
United States
2007-08-31 05:21:53
I've been using "The Regulator" : http://tools.osherove.com/CoolTools/TheRe
gulator/tabid/185/Default.aspx

On Aug 30, 8:04 pm, "Jacob LL" <jacob....gmail.com> wrote:
> Thanks
>
> I see, so this says...
>
> Starts (^) with (77) and ends ($) with 77.
>
> Do you have a link that you find helpful on RegEx?
>
> So would the opposite be:
> [^^77$]
>
> Thanks
>
> On 8/30/07, nschub...gmail.com <nschub...gmail.com> wrote:
>
>
>
> > so you want:  ^77$
> > ?
>
> > On Aug 30, 4:58 pm, JLL <jacob....gmail.com> wrote:
> > > Thanks Russ


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: New To RegEx
user name
2007-08-31 13:54:34
Thanks for all your help!

On 8/31/07, nschubachgmail.com">nschubachgmail.com < nschubachgmail.com">nschubachgmail.com > wrote:

I've been using "The Regulator&quot; : http://tools.osherove.com/CoolTools/TheRegulator/tabid/185/Default.aspx

On Aug 30, 8:04 pm, "Jacob LL" < jacob....gmail.com">jacob....gmail.com> wrote:
>; Thanks
>;
> I see, so this says...
&gt;
> Starts (^) with (77) and ends ($) with 77.
>
&gt; Do you have a link that you find helpful on RegEx?
>;
> So would the opposite be:
> [^^77$]
>
> Thanks
>;
> On 8/30/07, nschub...gmail.com">nschub...gmail.com < nschub...gmail.com">nschub...gmail.com> wrote:
>;
>
>
> > so you want: ; ^77$
> > ?
>
>; > On Aug 30, 4:58 pm, JLL < jacob....gmail.com">jacob....gmail.com> wrote:
>; > > Thanks Russ

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

[1-10] [11]

about | contact  Other archives ( Real Estate discussion Medical topics )