Skip to main content
Participating Frequently
October 30, 2024
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
October 31, 2024

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
October 30, 2024

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
October 30, 2024

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

Translate