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

  • Home
  • SEARCH
  • 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 6755575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:25:12+00:00 2026-05-26T13:25:12+00:00

I am stuck with a simple regex problem. What I want to do is

  • 0

I am stuck with a simple regex problem.
What I want to do is to check a URL to see if it contains the word ajax and if it does then match on the URL.

For instance
given URL localhost/ajax/image/get
should match and return localhost/ajax/image/get

However localhost/image/get
should not match.

I’ve basic knowledge of regex but havn’t been able to get anything working for it.

Any suggestions? I’m sure this is quite a simple case.

I am using this for a mod rewrite Rule

The mod rewrite rule is
RewriteRule ^.?\bajax\b.$ ajax.php?url=$1 [PT,L]

URL requested http://localhost:93/public/ajax/image/

It redirects to the ajax.php file but the url values are not preserved.

I have another rule which is a general one as follows
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]

URL requested http://localhost:93/public/imgage/get/

When this redirects to index.php it has /public/image/get/ in the url GET value

  • 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-26T13:25:12+00:00Added an answer on May 26, 2026 at 1:25 pm

    I solved the issue, the regex i was looking for is
    ^(.ajax.)$

    I had been trying ^(ajax)$ but this doesn’t make sense.

    Thanks for help

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm stuck on a RegEx problem that's seemingly very simple and yet I can't
Really got stuck on this simple regex. Need it to validate a string, that
I am stuck at one more RegEx. Sample input : project description I want
I'm stuck with this simple problem. Say I have a string which is consisted
I am stuck. I am trying to see if an textarea contains an #.
am a newbie in ruby on rails and am stuck with a simple problem
Very stuck on a problem which I thought would be pretty simple. As an
Very simple, I need to match the # symbol using a regex. I'm working
I'm stuck with a simple task. What I want to do is to transform
I'm stuck with this simple named route problem. I have: #Controller: def show @thing

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.