Skip to main content
Participating Frequently
Oct 30, 2024 8:46 PM UTC
Answered

regex find any neumeric value not contained in double quotes

10/30/2024

What is the correct regex syntax to find a numeric value not in double quotes?

Thanks for the help.

Carl

This topic is closed to new replies. Start a new post to keep the conversation going.
Nancy OShea
Nancy OSheaCorrect answer
Community Expert
Oct 31, 2024 8:03 PM UTC

Your old HTML code should be modernized to current HTML5 & CSS web standards.

 

Example:

https://www.w3schools.com/css/tryit.asp?filename=trycss_table_vertical-align

 

Code Validation Services:

HTML: https://validator.w3.org/

CSS: https://jigsaw.w3.org/css-validator/

 

Nancy O'Shea— Product User & Community Expert

6 replies

BenPleysier
Community Expert
Community Expert
Oct 30, 2024 9:34 PM UTC

To find numeric values not enclosed in double quotes, you can use a negative lookbehind and lookahead assertion in your regex pattern. Here's an example:

(?<!")\b\d+\b(?!")

Explanation:

  • (?<!") is a negative lookbehind assertion that ensures the numeric value is not preceded by a double quote.

  • \b\d+\b matches a numeric value. \b is a word boundary to ensure it's a standalone number, and \d+ matches one or more digits.

  • (?!") is a negative lookahead assertion that ensures the numeric value is not followed by a double quote.

 

Translate
Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Participating Frequently
Oct 30, 2024 9:50 PM UTC

Thanks for your time and help. the expression worked well. Your explanation was detailed and great. 

Translate