Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Replace empty alt tag on <img> tag -- dont use a regex

by Discipulus (Canon)
on Jan 20, 2022 at 12:17 UTC ( [id://11140640]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Replace empty alt tag on <img> tag
in thread Replace empty alt tag on <img> tag

> can I do the same with regular expression??

no, Why a regex *really* isn't good enough for HTML and XML, even for "simple" tasks

here at the monastery only tybalt89 owns a special permission to deal with HTML or XML using regular expressions

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^4: Replace empty alt tag on <img> tag -- dont use a regex
by eyepopslikeamosquito (Archbishop) on Jan 20, 2022 at 22:23 UTC

    > here at the monastery only tybalt89 owns a special permission to deal with HTML or XML using regular expressions

    Agreed that tybalt89 has earned it. To nitpick though, I think TheDamian is also worthy of this special permission.

    The PPR module provides a single regular expression that defines a set of independent subpatterns suitable for matching entire Perl documents

    -- from PPR by TheDamian (as if you couldn't guess ;-)

    See also these comments by kcott and haukex, discussing the differences between PPR and PPI.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11140640]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-26 09:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found