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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:58:54+00:00 2026-06-18T09:58:54+00:00

Possible Duplicate: Far Negative Lookbehind I’ve been trying for days to get this to

  • 0

Possible Duplicate:
Far Negative Lookbehind

I’ve been trying for days to get this to work. I had a similar question yesterday but it hasn’t really helped. Basically I’m trying to create a pattern that matches:

(a) where “a” can be any letter like: [a-zA-Z]. However, this should not match: paragraph (a), (b), (c), (d) or (e); because it starts with the word paragraph. If it were just (a), (b), (c), (d) or (e) then it should result in 5 matches being found.

http://regexr.com?33ka2

  • 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-18T09:58:55+00:00Added an answer on June 18, 2026 at 9:58 am

    This is what you are looking for

    ^(?![^()]*paragraph).*?\([a-zA-Z]\)
    

    use multiline option


    You can instead break down the problem by first taking all the lines that doesn’t contain paragraph and then collect the individual ([a-zA-Z])

     Pattern p=Pattern.compile("^(?!.*paragraph).*$",Pattern.MULTILINE);
     Matcher m=p.matcher(input);
     while(m.find())
     {
         Matcher mm=Pattern.compile("\\([a-zA-Z]\\)").matcher(m.group(0));
         while(mm.find())
         {
             System.out.println(mm.group(0));
         }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: get methodinfo from a method reference C# This is most likely something
Possible Duplicate: C#: Public Fields versus Automatic Properties Duplicate? I think not: This question
Possible Duplicate: Java random number with given length I have been trying to generate
Possible Duplicate: Add picture at facebook event with Graph API I have been trying
Possible Duplicate: How to get current time in ms in PHP? I am trying
Possible Duplicate: Classic ASP SQL Injection Protection So far, I've been very lucky not
Possible Duplicate: Getting exception as “Collection was mutated while being enumerated” This question is
Possible Duplicate: How to get the last day of a month? So far, I
Possible Duplicate: GUI threading in java I have been trying to make a text
Possible Duplicate: How can I understand nested ?: operators in PHP? Why does this:

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.