use Regexp::Common; use Data::Dumper; use v5.30.0; my $value = "+a1.2cd"; if ( $RE{num}{int} -> matches($value) ) { say "INTEGER patern:\t".$RE{num}{int}; say $value; say "It is Integer"; }elsif ( $RE{num}{real}->matches($value) ) { say "REAL patern:\t".$RE{num}{real}; say $value; say "It is Real"; }else{ say "It is String"; }
I tried Regexp::Common , but seams to behave weird to me. The code above is saying :
It is Integer
In reply to Re^2: A function to determine if a string is numeric
by zborsos
in thread A function to determine if a string is numeric
by juliosergio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |