Hi,

Sometimes the large path is the shortest one. Go through the tutorial in Perl 
for regular expressions and you will solve your questions and you will learn a 
lot.

About regular expressions are two points of view. First one says that you must 
learn and use it.

The other point of is: if you have a problem and you say I will solve it with 
regular expressions then you have two problems.

Ánimos!
Saludos
________________________________
From: Claude Brown via beginners <beginners@perl.org>
Sent: Monday, January 22, 2024 10:49:50 PM
To: k...@aspodata.se <k...@aspodata.se>; beginners@perl.org <beginners@perl.org>
Subject: RE: regex

Jorge,

Expanding on Karl's answer (and somewhat labouring his point) consider these 
examples:

$a =~ /Jorge/
$a =~ /^Jorge/
$a =~ /Jorge$/
$a =~ /^Jorge$/

This shows that regex providing four different capabilities:
- detect "Jorge" anywhere in the string
- detect "Jorge" at the start of a string (by adding ^)
- detect "Jorge" at the end of a string (by adding $)
- detect that the string is exactly "Jorge" (both ^ and $)

Replace "Jorge" with your pattern, and the result is the same.

Cheers,

Claude.





--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to