in reply to Getting Data from Between Two Commas
If I've interpreted the question correctly, this should do the trick:
my $search = "So, I went to the shops and I wanted to buy a book, but it was too expensive, and it sucked. Bleedin' Harry bleedin' Potter, who'd have thought!"; my $start = "shops"; my ( $match ) = $search =~ m/$start.*?,(.*?),/s; print $match;
Output:
but it was too expensive
|
|---|