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
In reply to Re: Regular Expression Help
by marto
in thread Regular Expression Help
by vskatusa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |