[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ColdFusion REFind -- why no match?

Posted on 2009-02-09
2
Medium Priority
?
984 Views
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 --->
</cfif>

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

/backend/animations/index.cfm

So it should match. Can anyone help?

Thanks!
0
Comment
Question by:masterorb
  • 2
2 Comments
 
LVL 7

Expert Comment

by:black0ps
ID: 23597726
Try
<cfif REFind("/backend/(\w)/index.cfm", CGI.REQUEST_URI) GT 0>
      <!--- execute code --->
</cfif>

Open in new window

0
 
LVL 7

Accepted Solution

by:
black0ps earned 2000 total points
ID: 23597729
You can also try
<cfif REFind("/backend/(\w)*.?/index.cfm", CGI.REQUEST_URI) IS NOT 0>
      <!--- execute code --->
</cfif>

Open in new window

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whatever be the reason, if you are working on web development side,  you will need day-today validation codes like email validation, date validation , IP address validation, phone validation on any of the edit page or say at the time of registration…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
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…
Suggested Courses
Course of the Month18 days, 19 hours left to enroll

834 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