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
|
|---|