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 3981068
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:21:57+00:00 2026-05-20T05:21:57+00:00

I need to alter a RegEx pattern. I currently have this which matches all

  • 0

I need to alter a RegEx pattern. I currently have this which matches all files ending in .aspx including the querystring:

.*\.aspx.*

I need an expression that matches all except foo.aspx or bar.aspx.

Here are some test strings; bad:

foo.aspx
http:\\www.mycompany.com\foo.aspx
http:\\www.mycompany.com\_app\bar.aspx?param=1

…and good:

http:\\www.mycompany.com\default.aspx
http:\\www.mycompany.com\_app\index.aspx?param=1
index.aspx

  • 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-20T05:21:58+00:00Added an answer on May 20, 2026 at 5:21 am

    On C#

    var rx = new Regex(@"^.*(?<!(^|\\|/)(foo|bar))\.aspx$");
    

    This will consider only the file name. / and \ are path separators.
    So C:\foo.bar is equivalent to foo.bar that is a no.

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

Sidebar

Related Questions

I have a text field which I need to validate using a regex. My
I have the following regex pattern: (.NET 1.1 Regex Validator) ^(?=.*[A-Za-z])[a-zA-Z0-9@\\-_\\+\\.]{6,32}$ I need to
I need a regex pattern which will accommodate for the following. I get a
Need some regex help in Java. I have a string, which contains text and
When I'm writing a Latex file, sometimes I need to remove all files which
I have the following rewrite rule that I need to alter in order to
I have unfortunately wandered into a situation where I need regex using Ruby. Basically
Ok, I have a pretty tricky regex problem. I need to match and replace
I hope this title makes sense - I need case-insensitive regex matching on BlackBerry
Here's what I need- RegEx to match a url pattern and rewrite it to

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.