Skip to main content
Participating Frequently
October 30, 2024
Answered

regex find any neumeric value not contained in double quotes

  • October 30, 2024
  • 1 reply
  • 704 views

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 has been closed for replies.
Correct answer Nancy OShea

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/

 

1 reply

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.

 

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.