I'm typing this from my laptop as my computer has died. This has 2 main
effects. The first is that I don't have a good list of the sponsors of the
RegEx editor on me and the second is that I don't have the source code for
it. On the other hand, I'll be able to get their names off of paypal and the
windows executable is on a server. Bottom line is that tomorrow you'll be
able to both see who has supported the creation of the visual RegEx editor
(and sponsor it yourself if you want) as well as download it for yourself.
Once my computer is up again I can work on getting a Mac and Linux version
of it (seperate from the full KDE).
That being said, lets look at Tony's request. What's needed is an
interigator that will build the RegEx based on the answers to some
questions. Lets take an example and the questions asked from it:
[EMAIL PROTECTED]
1. Is this the start of the line or can it be anywhere in a string?
2. Does the text before the @ sign (chosen as being non-text) have to be
only those characters or can they be any characters?
2a can the text be numbers as well?
2b can the text contain any non-letter/number characters?
2c is there a specific length to this segment?
2d must it start with a specific type of character?
2e must it end with a specific type of character?

Here are the answers:
2a - can be numbers
2b - can contain the characters -_.
2c - must be at least 1 character long
2d - must start with a letter or number (note may conflict with 2c and have
to be careful)
2e - no
Just based on that we'd have this before the @ sign
[a-z0-9][a-z0-9_.-]*
so far so good. It's a legal start of an email address (not a full one with
a text name as well, just the address).
Now we look after the @ sign and we see another non-text character (a
period). The next questions will have to deal with that and will follow the
same mold. The only additional questions are:
2f can this segment be repeated? (yes)
2g must each segment end in a period? (yes)
This will give us a total of:
([a-z0-9][a-z0-9_-]\.)+
The final section will have the following answers:
2a only letters
2b no
2c yes
2f no
and extra questions of
2h is there a set length to this segment? (yes)
2i is there a minimum (yes, 2)
2j is there a maximum (yes, 6)
and the end result will be
[a-z0-9][a-z0-9_.-]*@([a-z0-9][a-z0-9_-]\.)+[a-z]{2,6}
This is a perfect regex for an email address and it can be built with
questions alone. Some of the more advanced stuff might be a lot harder to
write using questions, but it can be done.

> Just as a point of reference, the actual regex for your whatever is
> [a-z]{4}[0-9]{4}[a-z]{4}[0-9]
>
> However, the real question is, how would the system know (for example)
that
> you meant for X and 1 to be indicative of [a-z] and [0-9] instead of a
> literal capital x and the literal numeral 1?  Language theory states that
> any system you create in this way must have a syntax as complex as (or
more
> complex than) the maximum complexity of regular expression it can create.
> About the best you can do is make the system easier to use by doing things
> like making the syntax more user-friendly or creating a visual editor for
> them.  Oh, wait.  Michael's got that second one in progress.  :-)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to