#!/usr/bin/perl -l # http://perlmonks.org/?node_id=1173839 use strict; use warnings; my $equation = '979x + 87y - 8723z = 274320'; #my @parts = ($equation =~ /^(?:(.*?)([xyz]))+/i); my @parts = grep defined, $equation =~ /(.*?)([xyz])|(.*?)=(.*)/gi; use Data::Dumper; print Dumper \@parts;
In reply to Re^3: Problem with capturing all matches with regex
by tybalt89
in thread Problem with capturing all matches with regex
by igoryonya
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |