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 13 of 16 Topic 986 of 1040
Post > Topic >>

Re: Help with RegEx?

by SparkyGuy <sparkyguy@[EMAIL PROTECTED] > Jan 10, 2008 at 08:58 PM

> Only if you anchor it, i.e.  "^.$" will match lines containing only a 
> single character.  Read this as "At the start of the input, match a 
> single character, which must be followed by the end of the line" 
> (newline or end-of-string).  A "." alone will match anything, other than

> an empty line.   Some regex matchers have options to implicitly anchor 
> the regex but others don't.

Ah. Thanks! It now works to identify specific numbers of characters, such
as:
     ^.....$  five characters
     ^..........$   ten characters, etc.

My goal is to select a range of numbers of characters, the general form of

which would be:

     .{5,10}

But in this limited set of sup****ted expressions, however, the range 
metacharacters must be escaped:

     \{5,10\}

So how do I incor****ate this with "."? I tried

     ^.\{5,10\}$ 

to no avail. Other permutations I can think of don't work either. 

Ideas?

> Don't know if anyone has suggested this, but one way to achieve the 
> match you want (in the original post) is to sort the characters of the 
> field prior to matching.  Then match against a simpler regex.  The 
> sorting eliminates the complications of specifying a regex that can cope

> with the arbitrary ordering of the input characters.  Of course it may 
> not be the most efficient thing to do depending upon the nature of the 
> input (quantity, likelihood of match etc...) and a complex regex may be 
> better.

I may have stated earlier (?) that I'm not working in a programming
language, 
but simply using RegEx to set up filters in an application that sup****ts
the 
basic set of RegEx expressions. The application presents a single field 
within which a single RegEx can be entered. In a single RegEx, can I sort
and 
match? 

Thanks for your help. It is very much appreciated.
 




 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:22:13 CST 2008.