ColdFusion REFind -- why no match?

Posted on 2009-02-09
Last Modified: 2013-12-24
Hello, I'm trying to test against the CGI.REQUEST_URI variable to see if it is in the format "/backend/<some_sub_folder>/index.cfm".

I tried to do this is ColdFusion with REFind function:

<cfif REFind("/backend/\w/index.cfm", CGI.REQUEST_URI) IS NOT 0>
      <!--- execute code --->

But that does not work.  When I dump the value, I do find that it is:


So it should match. Can anyone help?

Question by:masterorb
    LVL 7

    Expert Comment

    <cfif REFind("/backend/(\w)/index.cfm", CGI.REQUEST_URI) GT 0>
          <!--- execute code --->

    Open in new window

    LVL 7

    Accepted Solution

    You can also try
    <cfif REFind("/backend/(\w)*.?/index.cfm", CGI.REQUEST_URI) IS NOT 0>
          <!--- execute code --->

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
    If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now