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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:32:34+00:00 2026-05-30T23:32:34+00:00

[^abc] Any single character except: a, b, or c But how can I make

  • 0

[^abc] Any single character except: a, b, or c

But how can I make regex for any characters except sequence abc

So, something like that

"Hello abc awesome world".scan /[^(abc)]+/

Will return “Hello ” and ” awesome world”.

PS: And it is not about splitting the string

  • 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-30T23:32:36+00:00Added an answer on May 30, 2026 at 11:32 pm

    This is called lookaround, in your case you’ll want to use negative lookahead. I’m not sure about the exact syntax in Ruby, but something along (?!abc) might work. Note that the lookaround doesn’t consume any input, so you’ll need to have this followed by any pattern that you do want to match. Perhaps (?:(?!abc).)+ is what you’re looking for?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

what is a regex to find any text that has 'abc' but does not
I know that [abc] will match any one character from that set. The matched
In a string like abc fox fox fox ghi xyz how can i get
I would like to remove any ABC at the end of the string. The
I have some data on a single line like below abc edf xyz rfg
I would like to develop a command-line program that can process and give help
I have a single table with lots of records (> 100k) that I need
I have a LINQ to SQL query that when executed does not return any
Thanks for the contributions so far - I can see now that $rowq is
I have a string like this field1=1 field2=2 field3=abc I want to ouput 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.