| Newsgroups |
perl.cvs.perlfaq |
| Message-ID |
<[email protected]> |
cvsuser 02/08/13 04:48:46
Modified: . perlfaq4.pod
Log:
* FAQ sync for change #17710
* How do I determine whether a scalar is a number/whole/integer/float?
added mention of Regexp::Common
* How do I find matching/nesting anything?
added mention of Regexp::Common and (??{code})
Revision Changes Path
1.27 +7 -4 perlfaq/perlfaq4.pod
Index: perlfaq4.pod
===================================================================
RCS file: /cvs/public/perlfaq/perlfaq4.pod,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -w -r1.26 -r1.27
--- perlfaq4.pod 17 Jul 2002 17:46:17 -0000 1.26
+++ perlfaq4.pod 13 Aug 2002 11:48:46 -0000 1.27
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq4 - Data Manipulation ($Revision: 1.26 $, $Date: 2002/07/17 17:46:17 $)
+perlfaq4 - Data Manipulation ($Revision: 1.27 $, $Date: 2002/08/13 11:48:46 $)
=head1 DESCRIPTION
@@ -567,8 +567,9 @@
characters, a pattern like C</x([^x]*)x/> will get the intervening
bits in $1. For multiple ones, then something more like
C</alpha(.*?)omega/> would be needed. But none of these deals with
-nested patterns, nor can they. For that you'll have to write a
-parser.
+nested patterns. For balanced expressions using C<(>, C<{>, C<[>
+or C<< < >> as delimiters, use the CPAN module Regexp::Common, or see
+L<perlre/(??{ code })>. For other cases, you'll have to write a parser.
If you are serious about writing a parser, there are a number of
modules or oddities that will make your life a lot easier. There are
@@ -1923,7 +1924,9 @@
You can also use the L<Data::Types|Data::Types> module on
the CPAN, which exports functions that validate data types
-using these and other regular expressions.
+using these and other regular expressions, or you can use
+the C<Regexp::Common> module from CPAN which has regular
+expressions to match various types of numbers.
If you're on a POSIX system, Perl's supports the C<POSIX::strtod>
function. Its semantics are somewhat cumbersome, so here's a C<getnum>