c# - <double> RegEx catching IP addresses -


i'm using parser, mistakenly parses ip addresses double values. since know nothing regular expressions, take look:

addrule<double>("!!float", @"[-+]?(0|[1-9][0-9_]*)\.[0-9_]*([ee][-+]?[0-9]+)?",             m => convert.todouble(m.value.replace("_", "")), null); addrule<double>("!!float", @"[-+]?\._*[0-9][0-9_]*([ee][-+]?[0-9]+)?",             m => convert.todouble(m.value.replace("_", "")), null); addrule<double>("!!float", @"[-+]?(0|[1-9][0-9_]*)([ee][-+]?[0-9]+)",             m => convert.todouble(m.value.replace("_", "")), null); 

is there quick way fix that? (the error on first lambda expression)

alright, trick.

addrule<double>("!!float", @"^[0-9]*(?:\.[0-9]*)?$",             m => convert.todouble(m.value.replace("_", "")), null); 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -