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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:49:16+00:00 2026-06-05T01:49:16+00:00

i have some bad words set like : ‘aaa’,’bbb’,’ccc’ ( bad words can be

  • 0

i have some bad words set like :

'aaa','bbb','ccc'

( bad words can be also , “john”,”paul”,”ringo”) ( sorry @cyilan)

i dont want to allow bad word immediately followed by another/same bad word

aaa can be followed by a non-bad word and then to be followed by a bad word :

  ...aaaRoyibbb...  //ok
  ...cccRoyiaaa...  //ok

   ...aaabbb...// NOT OK
   ...cccbbb...// NOT OK
   ...cccccc...// NOT OK

a bad word is not allowed to be immediately followed with another/same bad word

I’ve tried some regexps but with no success..

any help will be much appreciated

  • 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-05T01:49:17+00:00Added an answer on June 5, 2026 at 1:49 am
    var str = "...aaabbb...";
    if(!str.test(/(?:aaa|bbb|ccc){2}/)){
        // passed
    }
    

    Chat revealed that what OP really wanted was:

    /^(?!(?:aaa|bbb|ccc)|.*(?:aaa|bbb|ccc){2}|.*(?:aaa|bbb|ccc)$)/
    

    But really really:

    ^(?!(?:aaa|bbb|ccc)\b|.*\b(?:aaa|bbb|ccc)\s+(?:aaa|bbb|ccc)\b|.*\b(?:aaa|bbb|cc‌​c)$)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some text i need to filter out a list of bad words
We have some applications that sometimes get into a bad state, but only in
Some text fields in my database have bad control characters embedded. I only noticed
I have a code like this: #!/usr/bin/env bash test_this(){ export ABC=ABC echo some output
I have some strange behaviour in my php script. For some reason, I can't
I have some values that are stored with core data, and I have opened
I have some spatial data I am mapping in R using the maps library.
I have some data in the html format. I am using Html.fromHtml(String) when setting
I have some problem with the Facebook plugins in the site: www.talnavarro.com In some
I have some data in array format which I wrote to a file in

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.