Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7494123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:19:31+00:00 2026-05-29T17:19:31+00:00

I have to do a site redirect through script for about 10 different URLS

  • 0

I have to do a site redirect through script for about 10 different URLS all containing the string “enterpriseloyalty”. I’m trying to write some RegEx to find out if the URL has this in it. To do so, I’m using a function I found on another question here (using classic asp for regular expression). The problem is that nothing is returning when I test it on the site “http://enterpriseloyaltyjournal.ca/“.

I’ve tested the regex in both http://gskinner.com/RegExr/ and http://www.pagecolumn.com/tool/regtest.htm with matching results of the regex “enterpriseloyalty[A-Za-z]*(?=.{1,1})” working, matching “enterpriseloyaltyjournal” in the URL string. But on the site, “Response.Write(“Results: ” & result.Submatches(0))” returns nothing at all. And to be honest, I don’t know if I am expecting a result of the matching string or what, but there’s just nothing at all returned.

When I just do an If InStr(Request.ServerVariables("SERVER_NAME"),"enterpriseloyaltyjournal.ca") > 0 Then statement, it comes back true. My code is below. Any help is greatly appreciated.

Function RegExResults(strTarget, strPattern)

    Set regEx = New RegExp
    regEx.Pattern = strPattern
    regEx.Global = true
    Set RegExResults = regEx.Execute(strTarget)
    Set regEx = Nothing

End Function

'Pass the original string and pattern into the function and get a collection object back'
Set arrResults = RegExResults(Request.ServerVariables("SERVER_NAME"), "enterpriseloyalty[A-Za-z]*(?=\.{1,1})")

'In your pattern the answer is the first group, so all you need is'
For each result in arrResults
    Response.Write("Results: " & result.Submatches(0))
Next

EDIT

I’m also trying the following with no results:

Regex.IgnoreCase = True
Regex.Pattern = "enterpriseloyalty[A-Za-z]*(?=\.{1,1})"
Response.Write("Results:" & Regex.Test(Request.ServerVariables("SERVER_NAME")))

Also, when I say “no results”, I mean nothing at all is returned. Not even the “Results:” portion. Though I’m not getting any type of error.

SOLVED

Changed the above code to look like:

Dim regex
Set regex = New RegExp
regex.IgnoreCase = True
regex.Pattern = "enterpriseloyalty[A-Za-z]*(?=\.{1,1})"
Response.Write("Results:" & regex.Test(Request.ServerVariables("SERVER_NAME")))

And it worked just fine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T17:19:36+00:00Added an answer on May 29, 2026 at 5:19 pm

    Found another way of doing it, and ended up using:

    Dim regex
    Set regex = New RegExp
    regex.IgnoreCase = True
    regex.Pattern = "enterpriseloyalty[A-Za-z]*(?=\.{1,1})"
    Response.Write("Results:" & regex.Test(Request.ServerVariables("SERVER_NAME")))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While performing some upcoming maintenance, I'm going to have to redirect all site traffic
So we have a site that we want to redirect all users to login
I was going through a site I have just completed, and fixing up some
I'm trying to get all HTML and PHP files on my site to redirect
I'm trying to write a check to redirect users based on their progress through
I Have done a site but want to redirect it to another subdomain in
I have a mobile site and I'd like to redirect users to the domain.mobi
I want to have site wide default settings for all jQuery validation uses on
I have a site that has been up for some time. I had a
I am using ColdFusion 9.0.1 I have a new site that is accessible through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.