Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Regular Expression Help

by marto (Cardinal)
on Apr 24, 2020 at 17:26 UTC ( [id://11116033]=note: print w/replies, xml ) Need Help??


in reply to Regular Expression Help

Doing such things with regex is no fun, and easily done wrong. Using Mojo::DOM:

#!/usr/bin/perl use strict; use warnings; use Mojo::DOM; use feature 'say'; my $html = '<span class="Trsdu(0.3s) Fw(b) Fz(36px) Mb(-4px) D(ib)" da +ta-reactid="33">'; my $dom = Mojo::DOM->new( $html ); say $dom->at('span.[class^=Trsdu]')->attr->{'data-reactid'};

Output:

33

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2024-04-18 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found