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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:12:40+00:00 2026-05-16T00:12:40+00:00

I need to match strings that don’t contain a keyword ( beta2 ) at

  • 0

I need to match strings that don’t contain a keyword (beta2) at an arbitrary position.

Consider:

var aStr    = [
                '/beta1/foo',
                'beta1/foo',
                '/beta1_xyz/foo',
                'blahBlah/beta1/foo',
                'beta1',

                '/beta2/foo',
                'beta2/foo',
                '/beta2_xyz/foo',
                'blahBlah/beta2/foo',
                'beta2',

                '/beat2/foo',
                'beat2/foo',
                '/beat2_xyz/foo',
                'blahBlah/beat2/foo',
                'beat2'
            ];

function bTestForMatch (Str)
{
    return /.*\b(?!beta2).*/i.test (Str);
}

for (var J=0, iLen=aStr.length;  J < iLen;  J++)
{
    console.log (J, bTestForMatch (aStr[J]), aStr[J]);
}

We need a regex that matches all strings that exclude beta2. beta2 will always start at a word boundary, but not necessarily end at one. It can be at a variety of positions in the string.

The desired results would be:

 0    true    /beta1/foo
 1    true    beta1/foo
 2    true    /beta1_xyz/foo
 3    true    blahBlah/beta1/foo
 4    true    beta1
 5    false   /beta2/foo
 6    false   beta2/foo
 7    false   /beta2_xyz/foo
 8    false   blahBlah/beta2/foo
 9    false   beta2
10    true    /beat2/foo
11    true    beat2/foo
12    true    /beat2_xyz/foo
13    true    blahBlah/beat2/foo
14    true    beat2

The regex is for a 3rd-party analysis tool that takes JavaScript regular expressions to filter sub-results. The tool takes a single line of regex. There is no API and we don’t have access to its source-code.

Is there a JavaScript regex that will filter the second beta results (beta2) from this analysis run?

  • 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-16T00:12:40+00:00Added an answer on May 16, 2026 at 12:12 am

    Try

    /^(?!.*beta2).*$/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a regex that will match strings of letters that do not contain
Alright, so i need to be able to match strings in ways that give
I need to create a regex that can match multiple strings. For example, I
From a string, I need to pull out groups that match a given pattern.
I need to match input strings (URLs) against a large set (anywhere from 1k-250k)
I need to match entries like {@x anything} in strings like a b c
I need to write code to determine if 2 strings match when one of
I need to match with preg_match the urls of a certain domain that end
I need a regex to match following strings: input ---> output ------------------------------ 1*a12*asd*315 --->
I need help with a regular expression that will find matches in the strings

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.