Re: A Regular Expression Problem in Perl 5.28

Uri Guttman <[email protected]> Tue, 28 Mar 2023 16:29:01 -0400
Newsgroups gmane.comp.lang.perl.beginners
Organization Which Clone Am I?
Message-ID <[email protected]>
On 3/28/23 16:17, Martin McCormick wrote:
>
> 	The string I am interested in testing for starts with 5
> or 6 digits in a row and all I need to do is determine that the
> first 5 or 6 characters are numbers Period.  That's all.
>
>
> my $regextest = '/^\d+\{5,\}/' ;

why are you escaping the {}?? those are meta chars that are needed to 
make that a 5+ range. just delete the backslashes on them and it will work.

you need to know when to backslash and when not too. all regex chars 
which do something are not backslashed. alpha chars with backslashes are 
regex char types and special chars.

thanx,

uri


-- 
https://uriguttman.blogspot.com/
A Long Strange Trip
A blog about computers, food, my life and silliness.


-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/