03-29-2011 06:25 AM
Hi,
I found regular expression as follows ione of teh VI.
Regular expression as: [-]?[.]?[0-9]+[.]?[0-9]*
The output is, it will extact the number from sentance.
Can any oneexplain me with an example (using multiple '?') please how does '?' works?
Many Thanks
Haneef
03-29-2011 07:02 AM
@Haneef wrote:
Hi,
I found regular expression as follows ione of teh VI.
Regular expression as: [-]?[.]?[0-9]+[.]?[0-9]*
From the help:
? Marks part of a pattern as one that can appear zero or one time in the input. For example, be? matches be in believe, be in bee, be in beep, and b in bat..
So your RegEx consist of the following parts:
[-]? 0 or 1 times the '-' sign
[.]? 0 or 1 times the '.' sign
[0-9]+ 1 or more numbers (0-9)
[.]? 0 or 1 times the '.' sign
[0-9]* 0 or more numbers (0-9)
Note that this regex doesn't deal with 'european' decimals using a ',' as decimal character.
Ton