You're not mistaken, it's quite far from PCREs. Generally you'll be using
posix expressions instead of the \char notation; so \d becomes [[:digits:]],
\w becomes [[:alpha:]], etc. Substrings are also quite different in the
handling (read: not nearly so nice). If you're on a dedicated server there
is a CFX tag for PCREs in CF that makes life so much easier for string
parsing and data validation.
(http://www.rixsoft.com/ColdFusion/CFX/PCRegEx/cfx_pcregex.html)

Here's a link from the old CF4 manual:

http://www.allaire.com/documents/cf4/Advanced_ColdFusion_Development/04_Regu
lar_Expressions/adv04.htm


Also read the reFind(), and reReplace() reference carefully (not the
clearest of tech writing I know):

http://www.allaire.com/cfdocs/CFML_Language_Reference/3_ColdFusion_Functions
/lr3_200.htm

http://www.allaire.com/cfdocs/CFML_Language_Reference/3_ColdFusion_Functions
/lr3_207.htm

>From the venerable Fig Leaf archives <g>:
        (only time I've ever seen back refferencing used properly in a tutorial on
CF regexps)
        http://www.figleaf.com/figleafhome/cfug/CFUGDec99/regexp/


Print refferences:
        Ben Forta's "Advanced Web Application Development" by Que

List of posix character classes:
        alnum   - alpha-numeric characters
        alpha   - alphabetic characters
        blank   - tab and space
        cntrl   - control characters
        digit   - decimal digits
        graph   - all printable characters except space
        lower   - lower case letters
        print   - "printable" characters
        punct   - punctuation
        space   - whitespace characters
        upper   - upper case letters
        xdigit- hexidecimal digits

   All the standard control characters work w/in the mask, so ^ $ ? *
{num,num} etc. Sub expressions (if you set return sub expressions to true)
are returned as start postion and length in an array, and the mid() function
has to be used to retrieve them. So for basic validation CF is okay, but
complex string handling gets long and tricky compared to Perl (but nothing
so annoying as string handling in C was).

   If you don't get the more advanced stuff (ie. back referencing, substring
manipulation, etc.) from the docs, I can send over some production code
examples that might help.


-----Original Message-----
From: Ruslan Sivak [mailto:[EMAIL PROTECTED]]
Sent: January 18, 2001 10:32
To: CF-Talk
Subject: RE: Validate against a mask


I also believe that I should use Regex, but I can't find any decent
reference for it for CF.  It seems to be quite different from Perl's regex.
Am I mistaken?

-----Original Message-----
From: Raymond B. [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 10:38 PM
To: CF-Talk
Subject: RE: Validate against a mask


Not sure if you've ever used regexps, but that is what you want. Check out
reFind() and the other regexp functions.

http://www.allaire.com/cfdocs/CFML_Language_Reference/3_ColdFusion_Functions
/lr3_200.htm

-----Original Message-----
From: Ruslan Sivak [mailto:[EMAIL PROTECTED]]
Sent: January 17, 2001 17:20
To: CF-Talk
Subject: Validate against a mask


Is there a way to validate against a mask like lets say in MS Access.  Is
there a CF function that does this?

Something like

ConformsToMask("mm-dd-yyyy","01-17-2001")
or
ConformsToMask("###-###-####","111-111-1111")


Ruslan Sivak
Technologist
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to