Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Mac Programmer > Re: Help with R...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 16 Topic 986 of 1040
Post > Topic >>

Re: Help with RegEx?

by dempson@[EMAIL PROTECTED] (David Empson) Jan 9, 2008 at 10:57 PM

SparkyGuy <sparkyguy@[EMAIL PROTECTED]
> wrote:

> I have reduced my requirements to just matching input that contains the
> letters "i n t u o" in that order even if interspersed with other
characters.
> 
> 
> The RE I worked out is:
> 
>      [Ii].*[Nn].*[Tt].*[Uu].*[Oo]
> 
> Thanks to all who helped me come to this result. 
> 
> I also need to match input that exceeds 50 characters. I tried several
REs,
> paring it down, eventually, to:
> 
>      .{50}
> 
> It doesn't work. 

That regular expression matches exactly 50 of any combination of
characters. Assuming your input is being processed on a line at a time
basis, it should match any line which contains a minimum of 50
characters.

> This seems like it should be pretty simple, but it's not working. It
works in
> regextester.com's tester, but it isn't working for me. Is there a
simpler (or
> different) way to check for input length? (I presume that my "flavor" of
> regex interpreter isn't accepting this form...)

The {} syntax is only available if your regular expression engine
sup****ts Perl-compatible regular expressions ("PCRE").

A simple regular expression has no way to represent quantity, other than
"zero or more" (*) or "one or more" (+).

To match at least 50 characters in a simple regular expression you would
need to enter 50 periods:

...................................................

-- 
David Empson
dempson@[EMAIL PROTECTED]

 




 16 Posts in Topic:
Help with RegEx?
SparkyGuy <sparkyguy@[  2008-01-05 23:07:58 
Re: Help with RegEx?
SparkyGuy <sparkyguy@[  2008-01-06 01:43:11 
Re: Help with RegEx?
dempson@[EMAIL PROTECTED]  2008-01-06 15:06:06 
Re: Help with RegEx?
SM Ryan <wyrmwif@[EMAI  2008-01-06 01:43:13 
Re: Help with RegEx?
Reinder Verlinde <rein  2008-01-06 15:25:24 
Re: Help with RegEx?
Paul Floyd <root@[EMAI  2008-01-06 15:25:32 
Re: Help with RegEx?
Ben Artin <macdev@[EMA  2008-01-08 21:27:23 
Re: Help with RegEx?
SparkyGuy <sparkyguy@[  2008-01-09 01:15:16 
Re: Help with RegEx?
dempson@[EMAIL PROTECTED]  2008-01-09 22:57:18 
Re: Help with RegEx?
SparkyGuy <sparkyguy@[  2008-01-09 18:28:01 
Re: Help with RegEx?
SparkyGuy <sparkyguy@[  2008-01-10 10:25:27 
Re: Help with RegEx?
John Whorfin <_@[EMAIL  2008-01-11 07:11:05 
Re: Help with RegEx?
SparkyGuy <sparkyguy@[  2008-01-10 20:58:02 
Re: Help with RegEx?
SparkyGuy <sparkyguy@[  2008-01-10 21:12:07 
Re: Help with RegEx?
dempson@[EMAIL PROTECTED]  2008-01-11 12:03:31 
Re: Help with RegEx?
Sherman Pendley <spamt  2008-01-10 18:20:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 9:37:00 CST 2008.