*** pod/perlfaq4.pod.orig Sat Jun 1 18:37:36 2002
--- pod/perlfaq4.pod Tue Jul 30 18:49:39 2002
***************
*** 570,582 ****
=head2 How do I find matching/nesting anything?
! This isn't something that can be done in one regular expression, no
! matter how complicated. To find something between two single
! 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.
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
--- 570,581 ----
=head2 How do I find matching/nesting anything?
! To find something between two single 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.
!
! For balanced expressions using C<(>, C<{>, C<[> or C<< < >> as delimiters,
! use the CPAN module Regexp::Common, or see L<perlre/(??{ code })>.
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
***************
*** 1926,1932 ****
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.
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>
--- 1925,1933 ----
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, 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>