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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:15:54+00:00 2026-06-09T22:15:54+00:00

I am trying the following: .+\?[^\?].+\? That is, match everything til a ?, then,

  • 0

I am trying the following:

.+\?[^\?].+\?

That is, match everything til a “?”, then, if no other “?” after that, match everything til another “?”. I guess it is not working because the first .+ matches the entire string already.

  • 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-06-09T22:15:55+00:00Added an answer on June 9, 2026 at 10:15 pm

    Your description isn’t precise, but here’s the rules I assume you need your regex to satisfy:

    1. Zero or more characters that are not ‘?’
    2. A ‘?’
    3. One or more characters that are not ‘?’
    4. A ‘?’

    This is actually pretty simple.

    [^?]*\?[^?]+\?
    

    Note that this will match a substring of a larger string. If you need to ensure the entire string exactly matches this, throw in ^ and $ anchors:

    ^[^?]*\?[^?]+\?$
    

    Explanation:

    1. ^

      Start of the string. In a multiline context this also matches start of the line, but you’re probably not in a multiline context.

    2. [^?]

      Match anything that’s not the literal character ‘?‘.

    3. *

      Match zero or more of the previous token.

    4. \?

      Match a literal ‘?‘.

    5. [^?]

      Match anything that’s not the literal character ‘?‘.

    6. +

      Match one or more of the previous token. This ensures that you cannot have two ‘?‘ in a row.

    7. \?

      Match a literal ‘?‘.

    8. $

      Match the end of the string (or the end of the line in a multiline context).


    Note: I assumed zero or more non-‘?‘ before the first ‘?‘. This will match something like ?abc?. If this is illegal, change the first * to a +.

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

Sidebar

Related Questions

I am trying to run the following code that I found marked as correct
I've got the following code that I am trying to use to access a
I have the following code that I am trying to extract the systems proxy
I have the following code that i am trying to change from a regular
I have the following data set that I am trying to plot with ggplot2,
I have the following code sample that im trying to wrap my head around
I have the following log entry that I am processing in PowerShell I'm trying
In C#.net, I have the following DataSource setup that I am trying to dynamically
Lets say that I'm trying to create a new process with the following code:
I am trying to create an android app that has the following: Theme set

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.