So here is my simplified code, and at the bottom is just a bit of the data in the $tagl scalar.
my $tagl = $resp->decoded_content; if($tagl =~ /<div class=\"soda.*?>(.*?)<\/div>/ism) { say "inside"; my $grp = $1; say $grp; }
I know I get a match, because I do get the "inside" msg. But $1 is nothing. Am far from an expert in regex, but have used this before and I have no idea why I get the match, but not the group to extract. I made the pattern match in RegEx101.com, and in there it works. And yes, I know I will have to trim the extra whitespaces, but I can't even extract the group right now.
If anyone knows what I'm missing.....thank you in advance.
I post the data in a code format because it comes out cleaner here
</div> </div> <div id="taglines_content" class="header"> <div class="header"> <div class="nav"> <div class="desc">Showing all +3 taglines</div> </div> </div> <div class="soda odd"> Power. Grace. Wisdom. Wonder. </div> <div class="soda even"> Wonder. Power. Courage. </div> <div class="soda odd"> The future of justice begins w +ith her </div> </div> </div> <div class="article" id="see_also"> <h2>See also</h2> <p> <span class="nobr"> <a href="/title/tt0451279/plotsumm +ary?ref_=tttg_sa_1" class="link">Plot Summary</a> <span class="ghost">|</span> </span> <span class="nobr"> <a href="/title/tt0451279/synopsis +?ref_=tttg_sa_2" class="link">Synopsis</a> <span class="ghost">|</span> </span> <span class="nobr"> <a href="/title/tt0451279/keywords +?ref_=tttg_sa_3" class="link">Plot Keywords</a> <span class="ghost">|</span> </span> <span class="nobr"> <a href="/title/tt0451279/parental +guide?ref_=tttg_sa_4" class="link">Parents Guide</a> </span> </p> </div> <script> if ('csm' in window) {
In reply to I match a pattern in regex, yet I don't get the group I wanted to extract for some reason by SergioQ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |