Gossamer Forum
Home : Products : Links 2.0 : Customization :

Links.def Definition needed for use of Last ''

Quote Reply
Links.def Definition needed for use of Last ''
Does anyone know some uses for the last '' and next to last '' in the Definition of your database file. I could not find any info on this anywhere. (including the resource center). I would like some examples of any nifty things that can be put in those fields and what those nifty things will do.
Thanks
TimRyan
Quote Reply
Re: Links.def Definition needed for use of Last '' In reply to
   
Quote:
Does anyone know some uses for the last '' ...

Those hold regular expressions (RE) to make sure the data entered is of proper format. eg. from links.def:

^http|news|mailto|ftp checks to make sure the field starts with a http OR news OR mailto OR ftp.

.+@.+\..+ checks to make sure one or more characters is followed by an @ symbol, then one or more characters, then a . and then finally one or more characters.

\d+ checks to make sure one or more numerical digits is present.

^[\d\.]+$ checks for either a number or a . at the beginning of the data, then one or more of the last character and ending with a end of line.

^\d+$ checks for a number at the start of the line, then one or more of the some, then and end of line.

No|Yes checks if either No OR Yes was entered.

You can design them to do lots of things. Have a look at agora.leeds.ac.uk/Perl/matching.html for a short lesson on REs in Perl.

If you're really interested in working with Perl, you should get the book Mastering Regular Expressions www.amazon.com/exec/obidos/ASIN/1565922573/appliances . Of course I will appreciate the commission if you buy it from them. >%~}

Quote:
and next to last '' in the Definition of your database file.

That is for the default data that will be displayed in a form field before the user enters anything.

Dan O.


[This message has been edited by DanO (edited July 26, 1999).]
Quote Reply
Re: Links.def Definition needed for use of Last '' In reply to
There is a book in the works, with a PDF version of the chapter on regex's (pretty good one, too)


http://www.effectiveperl.com/toc.html


no affiliation with this, just found it last night while surfin'
Quote Reply
Re: Links.def Definition needed for use of Last '' In reply to
Thanks both. DanO, that was well plotted out and covers all I was thinking about when I looked at the code. I will look up those other resources also.

TimRyan