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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:31:14+00:00 2026-06-17T22:31:14+00:00

Here is my regex pattern: [Ss]ection\s\d+(?![a-zA-z])(?!</ref>) For example, it should match: section 5 or

  • 0

Here is my regex pattern: [Ss]ection\s\d+(?![a-zA-z])(?!</ref>)

For example, it should match: section 5 or section 50

For example, it should not match: section 5A or section 5</ref> or section 5A</ref> or section 50A

Problem is that in reality it matches them wrong: http://regexr.com?33ien

Not sure what’s wrong with the pattern though…

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

    Maybe try [Ss]ection\s\d++(?![a-zA-z])(?!</ref>). ++ is possessive quantifier. This quantifier is similar to greedy quantifier except it blocks fragment of string that it matched from being used by later part of regex.

    Example

    System.out.println("ababab".matches("(ab)++ab")); 
    // prints false since last "ab" is possessed by (ab)++ 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my regex code: preg_match_all('/background[-image]*:[\s]*url\([|\']+(.*)[|\']+\)/', $css, $matches, PREG_SET_ORDER); It looks for CSS that looks
I'm not understanding why my regex pattern doesn't seem to work. Here is an
I need a regex pattern(s) that will match on words before a colon and
I'm struggling with getting my regex pattern to match. Here are my requirements... Match
I have a little problem on RegEx pattern in c#. Here's the rule below:
Problem: Current regex pattern does not filter all lines. Adding ^ to the beginning
Trying to create a regex pattern for email address check. That will allow a
My preg_replace pattern regex code here.. /<img(.*?)src=(.*?)/ This is my replace code.. <img$1src='.$path.'$2 So
I'm trying to create a regex pattern to match the lines in the following
I have some strings to check against a Regex pattern. Here is the regex:

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.