Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: Replace empty alt tag on <img> tag

by The Perlman (Scribe)
on Jan 20, 2022 at 16:42 UTC ( [id://11140648]=note: print w/replies, xml ) Need Help??


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

Generally yes, at least since Perl regex are turing complete

The real question should be: Is it possible with a simple regex?

Answer: No.

A regex parsing HTML wouldn't be less complex than a full scale HTML parser and consist of various nested sub expressions.

Certainly not a one liner.

- Ron
  • Comment on Re^4: Replace empty alt tag on <img> tag

Replies are listed 'Best First'.
Re^5: Replace empty alt tag on <img> tag
by Fletch (Bishop) on Jan 20, 2022 at 19:32 UTC

    Unless you're talking about mucking with specific bits of *ML text with specific, limited formatting that you know is never going to vary then even letting regexen enter anywhere near your thoughts is probably heading deep into now you have two problems territory.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re^5: Replace empty alt tag on <img> tag
by Anonymous Monk on Jan 20, 2022 at 18:25 UTC
    Generally yes

    Please do feel free to share your implementation.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-19 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found