RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Metric Measurement
Expression
(?<value>([\+-]?((\d*\.\d+)|\d+))(E[\+-]?\d+)?)( (?<prefix>[PTGMkmunpf])?(?<unit>[a-zA-Z]+)?)?
Description
Used for matching measurement expressions with or without scientific notation, with or without a list of known prefixes, and with an option component of a unit. Known limitations include that a measurement term cannot lack a prefix and also start with a letter that could be mistaken for a prefix. For instance, "5 m" is parsed as 5 with a prefix of m, not 5 with a base prefix and a unit of m.
Matches
1 uW, 1 mW, 1 W, 1 m, 1.5 W, .5 W, 5E-12 F, 5 nF
Non-Matches
mW, 5- mW, 5mW
Author Rating: Not yet rated. Sean Duggan
Source Afmetcal
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials