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

Please support RegExLib Sponsors

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 32 regular expressions found.

Change page:   |    Displaying page 1 of 2 pages; Items 1 to 20
Title Test Details Pattern Title
Expression
^\d*\.?\d*$
Description
Matches any unsigned floating point number/numeric string. Also matches empty strings.
Matches
123 | 3.14159 | .234
Non-Matches
abc | -3.14159 | 3.4.2
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
^[-+]?\d*\.?\d*$
Description
Matches any floating point numer/numeric string, including optional sign character (+ or -). Also matches empty strings.
Matches
123 | +3.14159 | -3.14159
Non-Matches
abc | 3.4.5 | $99.95
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$
Description
This matches floating point expression in a more rigorous way - accepts both exponent as well as non exponent notations.
Matches
123 | -123.35 | -123.35e-2
Non-Matches
abc | 123.32e | 123.32.3
Author Rating: The rating for this expression. Srinivas Gummadi
Title Test Details Pattern Title
Expression
^[0-9](\.[0-9]+)?$
Description
matches non-negative decimal floating points numbers less than 10
Matches
1.2345 | 0.00001 | 7
Non-Matches
12.2 | 1.10.1 | 15.98
Author Rating: The rating for this expression. Snikwad Kcirtap
Title Test Details Pattern Title
Expression
^[-]?([1-9]{1}[0-9]{0,}(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|\.[0-9]{1,2})$
Description
This regular expression will match on a real / decimal / floating point / numeric string with no more than 2 digits past the decimal. The negative sign (-) is allowed. No leading zeroes or commas. It is based on a currency regular expression by Tom Persing.
Matches
123 | 123.54 | -.54
Non-Matches
123.543 | 0012 | 1,000.12
Author Rating: Not yet rated. T H
Title Test Details Pattern Title
Expression
(\s|\n|^)(\w+://[^\s\n]+)
Description
will match free floating valid protocol + urls in text ... will not touch the ones wrapped in a tag, so that you can auto-link the ones that aren't :) couple of things to know : 1. if the url is next to a tag this won't work (eg : <br>http://www.acme.com), the url must either start with a \s, \n or any character other than >. 2. the pattern will match the preceding \s and \n too, so when you replace put them back in place $1 will either be \s or \n, $2 will be the exact match vb usage : set re = New RegExp re.Pattern ="(\s|\n|^)(\w+://[^\s\n]+)" strResult = re.Replace(strText, "$1<a href='$2' target='_new'>$2</a>")
Matches
http://www.acme.com | ftp://ftp.acme.com/hede | gopher://asdfasd.asdfasdf
Non-Matches
<a href="http://acme.com">http://www.acme.com</a> | <br>http://www.acme.
Author Rating: The rating for this expression. ic onur
Title Test Details Pattern Title
Expression
^-?\d*(\.\d+)?$
Description
Matches all positive & negative decimal floating point numbers, to any magnitude. Allows empty string.
Matches
4.4 | .4 | -.4
Non-Matches
. | ... | zero
Author Rating: The rating for this expression. Murray Roke
Title Test Details Pattern Title
Expression
^(\-)?\d*(\.\d+)?$
Description
Matches all positive decimal floating negative/non-negative numbers. Allows empty string.
Matches
0.55 | 21232.00 | -89.20
Non-Matches
asdf | +0.33
Author Rating: Not yet rated. Harshang Pandya
Title Test Details Pattern Title
Expression
^[\-]{0,1}[0-9]{1,}(([\.\,]{0,1}[0-9]{1,})|([0-9]{0,}))$
Description
Simple checker for user's float types input.
Matches
-1.0 | 1234 | 12,34
Non-Matches
-1. | 12a4 | .34
Author Rating: Not yet rated. Stas Orlovsky
Title Test Details Pattern Title
Expression
^\d+(\.\d+)?$
Description
Matches any unsigned floating point number/numeric string.
Matches
123 | 3.14159
Non-Matches
abc | -3.14159 | 3.4.2 | .234 | .
Author Rating: The rating for this expression. bamerl
Title Test Details Matching urls in free text
Expression
((www|http)(\W+\S+[^).,:;?\]\} \r\n$]+))
Description
A regular expression which allows me to find strings of text floating around in free text that are in fact URLs. I need to tag these as <url>www.bmj.com/advice</url>. The problem has been allowing special characters in the url, but not mixing them up with genuine punctuation marks at the end of the url in the text-e.g. '.' or '?' or ) or ';' etc)
Matches
www.bmjpg.com/advice&search=?light+dark
Non-Matches
www.bmjpg.com/advice&search=?light+dark?
Author Rating: The rating for this expression. Sean Harrop
Title Test Details Pattern Title
Expression
^-?\d+(\.\d+)?$
Description
Matches any unsigned or signed floating point number/numeric string.
Matches
123 | 3.14159 | -1.2
Non-Matches
abc | 3.4.2 | .234 |
Author Rating: Not yet rated. bamerl
Title Test Details SqlServer Floating point
Expression
^(([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?([12]?\d\d?|30[0-8])))?)?$
Description
SqlServer seems to throw an error when using higher than e308 for e-309 it just makes the value = 0. Either way, this regexp seems to work for me. and allows for empty string as well. To negate the empty string pass through in asp.net just add a required field validator--if your already program asp.net you probably already know that though : ) .
Matches
-9.9e-308 | 9.9 | 9
Non-Matches
-9.9e-309
Author Rating: Not yet rated. Andrew
Title Test Details Floating Complex Number
Expression
^([-+]?(\d+\.?\d*|\d*\.?\d+)([Ee][-+]?[0-2]?\d{1,2})?[r]?|[-+]?((\d+\.?\d*|\d*\.?\d+)([Ee][-+]?[0-2]?\d{1,2})?)?[i]|[-+]?(\d+\.?\d*|\d*\.?\d+)([Ee][-+]?[0-2]?\d{1,2})?[r]?[-+]((\d+\.?\d*|\d*\.?\d+)([Ee][-+]?[0-2]?\d{1,2})?)?[i])$
Description
DESCRIPTION Parses a complex number of kind 'a+bi' from an input string. Please remove all spaces from the input string before using this regex pattern. MATCHING EXAMPLES '[]' means is an optional parameter; '|' means OR; '+' is the positive sign; '-' is the negative sign; '#' is one ore more decimal digits; 'E|e' are the valid exponent symbols; '...' is the range for the exponent; 'r' means the real part of complex number; 'i' means the imaginary part of complex number. NOTE Has the imaginary part of the input string not a numeric value (e.g. '5-i' is a valid format) it should be interpreted as '5-1i'!
Matches
[+|-]#[.[#]]|[#].#[E|e[+|-]0...299][r] -OR- [+|-][#[.[#]]|[#].#[E|e[+|-]0...299]]i -OR- [+|-]#[.[#]]|[#].#[E|e[+|-]0...299][r]+|-[#[.[#]]|[#].#[E|e[+|-]0...299]]i
Non-Matches
[+|-][.][E|e[+|-][0...299]][r] -OR- [+|-].[E|e[+|-][0...299]]i -OR- [+|-][.][E|e[+|-][0...299]][r]+|-[#[.[#]]|[#].#[E|e[+|-][0...299]]]i -OR- any number with more than one sign or decimal seperator -OR- any string with non-leading signs on mantissa and on exponent
Author Rating: The rating for this expression. Fischer, M.
Title Test Details Floating Complex Number Accessible
Expression
^((?<r>([-+]?(\d+\.?\d*|\d*\.?\d+)([Ee][-+]?[0-2]?\d{1,2})?[r]?))|(?<i>([-+]?((\d+\.?\d*|\d*\.?\d+)([Ee][-+]?[0-2]?\d{1,2})?)?[i]))|(?<r>([-+]?(\d+\.?\d*|\d*\.?\d+)([Ee][-+]?[0-2]?\d{1,2})?[r]?))(?<i>([-+]((\d+\.?\d*|\d*\.?\d+)([Ee][-+]?[0-2]?\d{1,2})?)?[i])))$
Description
This is the same regex pattern as 'Floating Complex Number' but extented by group names. This makes it much easier to extract the parts of the complex number (e.g. string realPart=myMatch.Result("${r}");string imgPart=myMatch.Result("${i}"); ).
Matches
see base example
Non-Matches
see base example
Author Rating: Not yet rated. Fischer, M.
Title Test Details Floating Number
Expression
^([-+]?(\d+\.?\d*|\d*\.?\d+))$
Description
DESCRIPTION Parses a floating number (such as double or float) from an input string. Please remove all spaces from the input string before using this regex pattern. MATCHING EXAMPLES The following symbols are used: '[]' means optional parameter; '|' means OR; '+' is the positive sign; '-' is the negative sign; '#' means one or more decimal digits; '.' is decimal seperator.
Matches
[+|-]#[.[#]]|[#].#
Non-Matches
[+|-][.] -OR- any floating number with an exponent (e.g. 1.0E-8) -OR- any string with more than one sign or decimal seperator -OR- any string with non-leading sign
Author Rating: Not yet rated. Fischer, M.
Title Test Details Floating Number With Exponent
Expression
^([-+]?(\d+\.?\d*|\d*\.?\d+)([Ee][-+]?[0-2]?\d{1,2})?)$
Description
DESCRIPTION Parses a floating number with an optional exponent from an input string. Please remove all spaces from the input string before using this regex pattern. MATCHING EXAMPLES The following symbols are used: '[]' means an optional parameter; '|' means OR; '+' means the positive sign; '-' means the negative sign; '#' means one or more numbers (0...9); '.' is the decimal seperator; 'E|e' are the valid exponent symbols; '...' is the range of values for the exponent.
Matches
[+|-]#[.[#]]|[#].#[E|e[+|-]0...299]
Non-Matches
[+|-][.][E|e[+|-][0...299]] -OR- [+|-]#[.[#]]|[#].#E|e[+|-]300...∞ -OR- any string with more than one sign on mantissa or on exponent -OR- any string with non-leading signs on mantissa or exponent -OR- any string with more than one decimal seperator on mantissa | any string with one or more decimal seperators on exponent
Author Rating: Not yet rated. Fischer, M.
Title Test Details Real Float Number
Expression
[+-]?+(?>\d++\.?+\d*+|\d*+\.?+\d++)
Description
This regex is designed to fail fast (using possessive quantifiers) while still matching a floating decimal number all the time. Won't match scientific notation or fractions. Can be combined with other patterns. Note: This site's tester does not support them. If your language does not support possessive quantifiers try the following: (?>[+-]?)(?>(?>\d+)(?>\.?)(?>\d*)|(?>\d*)(?>\.?)(?>\d+))
Matches
+7 | -7.7 | .7 | 7. | etc
Non-Matches
1/7 | 7e10
Author Rating: The rating for this expression. Trinithis
Title Test Details Number
Expression
^[-]?([1-9]{1}[0-9]{0,}(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|\.[0-9]{1,2})$
Description
This regular expression will match on a real / decimal / floating point / numeric string with no more than 2 digits past the decimal. The negative sign (-) is allowed. No leading zeroes or commas. It is based on a currency regular expression by Tom Persing.
Matches
123 | 123.54 | -.54
Non-Matches
123.543 | 0012 | 1,000.12
Author Rating: Not yet rated. Key Sutim
Title Test Details Javascript Tokenizer
Expression
(\/\*[\s\S.]+?\*\/|[/]{2,}.*|\/((\\\/)|.??)*\/[gim]{0,3}|'((\\\')|.??)*'|"((\\\")|.??)*"|-?\d+\.\d+e?-?e?\d*|-?\.\d+e-?\d+|\w+|[\[\]\(\)\{\}:=;"'\-&!|+,.\/*])
Description
Tokenize a Javascript document for parsing each token is a language-token : string, int, float, comment, multiline comment, operator, expression etc. etc.
Matches
var a = 12.5 * 5 + 3e9;var b = "str'\"ing";var c = 'str"\'ing';var d = /regex/gi;var e = Func();
Non-Matches
spaces/newline/tab
Author Rating: The rating for this expression. Martin Kirk
Change page:   |    Displaying page 1 of 2 pages; Items 1 to 20

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