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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 4
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.
   Displaying page 1 of 1 pages; Items 1 to 4

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