Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#1

RegExpr to detect integers

  Alt 16. Apr 2015, 10:24
Hi, I'm not sure is valid place for this question... But...

I want to extract numbers from string and Iactually did it with RegExpr. I have routines for floats and floats with unit (for data size, transfer speed and bandwidth). Floats look to be more complicated, but because there are more complicated it's easier to implement. For integers I have this:

Code:
[-+]?\d+

So, this can extract digits, not numbers, for example it returns "1.23" as "1" and "23", but should retun nothing (this is not integer, but float value). How it should be to recognize integers and do not split floats?
  Mit Zitat antworten Zitat