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

The Archive Base Latest Questions

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

I have a regex that checks that a phrase is included: var regex =

  • 0

I have a regex that checks that a phrase is included:

var regex = new RegExp( "(\\s|\\b)" + phrases[i] + "(\\s|\\b)", "i" );
var result = regex.test( value );

What I need it to do is ignore the phrase if it’s between brackets [] AND parentheses ().

I’m actually using Markdown to generate the HTML, but I don’t want it to accept the phrase if it’s in a Link or Image markdown syntax.

Example:

Requiring the phrase ‘test’, it will accept:

dfg dfg df [gdf](http://test123.com "test") gdfg df gdfg

Because ‘test’ is in the link title.

If I can get it to ignore the phrase inside the syntax [...](...) it would be awesome.

If not, just ignoring anything between brackets or parentheses would work.

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

    You can parse out brackets followed by parenthesis with this regex.

    var string = 'dfg dfg df [gdf](http://test123.com "test") gdfg df gdfg'
    string.replace(/\[.*\][(].*[)]/g,'');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this regex that checks the validity of an email address var reg
I have this regex that checks for a 5 digit number ^\d{5}$ How do
Does anyone have a regex that checks if a string is a valid AD
Say I have a regex that checks for alphanumeric. I now want to create
I have a string and multiple regex's, for example a regex that checks if
I need a regex that checks if a string only contain letters(a-z) and that
I have a piece of code in c# that checks, if a value is
I currently have a coldfusion regex that checks whether a string is alphanumeric or
I have the following regex that checks for a password policy. it is validated
I have the following REGEX that checks for a pattern like (alpha and decimals

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.