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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:37:32+00:00 2026-05-11T15:37:32+00:00

I am looking for a regular expression to determine when any of the values

  • 0

I am looking for a regular expression to determine when any of the values in a 32-bit hex value is non-zero.

The data patterns look like 0x00000000 and I want to know when any of the digits is non-zero. For example, if 0x00001000 or 0x10000000 or 0xB000000 would be capture by the regular expression, but not a 0x00000000 pattern. Right now I perform a walking pattern match of

0x[^0] 0x0[^0] 0x00[^0] ... 0x0000000[^0] 

This will work, but I much rather have one pattern if possible. Thanks.

Mark

Edit: I didn’t mention as the RegEx was not needed in a program, otherwise I would have used a different approach, but I was using the RegEx to search for values in a log file using UltraEdit. I could have developed a program or some other means to search, but I was just being lazy, just being honest. Ben S solution worked both in UltraEdit and Rad Software Regular Expression Designer. rampion solution didn’t work in either tool, not sure why.

  • 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. 2026-05-11T15:37:33+00:00Added an answer on May 11, 2026 at 3:37 pm

    Why not test the hex value against zero? Simpler, faster, more readable.

    If a regular expressiong is really necessary, 0x0*[1-9a-fA-F][0-9a-fA-F]* should do it.

    It looks for as many zeros as it can until it finds a non-zero hex value, then gathers the rest of the hex regardless of if it’s a zero or not.

    Note: this will match any length hex, not just 32 bits.

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

Sidebar

Related Questions

I'm looking for a regular expression which can accept any value from 1 to
Hi guys I am looking for a regular expression which will not match any
I'm looking for a regular expression to isolate the src value of an img.
I am looking for a regular expression that will match any number from 1
I am looking for a Regular expression to match only if a date is
I'm looking for a regular expression that will match all strings EXCEPT those that
Looking at the mozilla documentation , looking at the regular expression example (headed "Creating
Given a regular expression, I'm looking for a package which will dynamically generate the
I'm looking for a .NET regular expression extract all the URLs from a webpage
I'm looking for a method to assign variables with patterns in regular expressions with

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.