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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:49:10+00:00 2026-06-10T08:49:10+00:00

I want to exclude a specific number like 4800 from a string of numbers

  • 0

I want to exclude a specific number like 4800 from a string of numbers like 569048004801.
I’m using php for this and the method preg_match_all some pattern’s examples I have tried :

/([^4])([^8])([^0])([^0])/i
/([^4800])/i
  • 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-10T08:49:11+00:00Added an answer on June 10, 2026 at 8:49 am
    /([^4])([^8])([^0])([^0])/i
    

    This actually says, a sequence of four characters that is not “4800”. Close.

    /([^4800])/i
    

    This actually says, a single character that is not ‘4’, ‘8’, or ‘0’.

    Assuming you mean to capture a number that doesn’t contain “4800” in it, I think you might want

    /(?!\d*4800)\d+/i
    

    This says, check first that we’re not looking at a string of numbers with “4800” somewhere, and provided this is the case, capture the string of numbers. It’s called a “negative lookahead assertion”.

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

Sidebar

Related Questions

I want to exclude a field using Dozer like this : <mapping> <class-a>com.core.model.Model</class-a> <class-b>com.core.model.ModelIS</class-b>
Using BC 2.3.1 I'd like to exclude the following specific difference from being flagged
I want to redirect non-www to www, and exclude a specific file (eg. testit.php).
I want to exclude the following characters from my string: \-- ' < >
I'm using netbeans and I want to wrap $this->escape(stuff) around specific stuff in more
I want to excluse a specific filename (say, fubar.log ) from a shell (bash)
I want to extend the standard asp.net email regex validator to exclude a specific
Is there a way to exclude a specific folder inside of /app from being
Is there a way to exclude a processor from normal scheduling? That is, using
How to exclude specific descendants of a node? In this direction, the expression *[not(self::nodetag)]

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.