Re: Width | Height Regular Expression

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




I hope this is any help:

three digits:
\d{3}

between one and three digits:
\d{1,3}

percent number (max 100):
(?:100|\d{1,2})\s?%

px/cm:
\d{1,3}\s?(?:px|cm)

On 2 Feb., 17:19, jper...@xxxxxxxxx wrote:
I'm horrible with regular expression and looking for some help.
Searched around and didn't see this one anywhere:
I need a regex to validate a valid height or width.

nnn
nnn% ( ! > 100)
nnn (px | cm)

any help greatly appreciated!!

.



Relevant Pages

  • Re: JSP form beginner question
    ... >> or you could validate the input with regEx ... Accept zero or more digits. ...
    (comp.lang.java.help)
  • Re: RegExp
    ... On a related note, the following regex is intended to capture "IN (23, ... Set myMatch = myMatches ... your regex will not do what you want. ... So, matching as much as it can, that will include all the digits except for the ...
    (microsoft.public.excel.programming)
  • Re: How to make sure a string doesnt contain any integer??
    ... private int isValid(ref string word) ... // myString contains digits ... in which case modifying the Regex accordingly would be easy. ...
    (microsoft.public.dotnet.csharp.general)
  • Re: Can anyone help me with a quick PERL question?
    ... > this technical savy group can help me. ... But the next time you need Perl help head to ... I believe the problem is at the end of your regex. ... letters and digits. ...
    (Fedora)
  • Re: best design for parse
    ... Regular Expressions (Regex) are about pattern matching, ... by a slash followed by 2 digits followed by a slash followed by 4 digits. ... That immediately takes care of 2 of your 'formats'. ...
    (microsoft.public.dotnet.languages.vb)