Is it possible to do something like this? Thanks in advance!#!/usr/bin/perl -w use strict; my $string = "Field1: one"; my @regex; push(@regex, 'm/Field1: (\w{3})/'); push(@regex, 'm/Field2: (\w{3})/'); push(@regex, 'm/Field3: (\w{3})/'); foreach $_ (@regex) { $string =~ $_; print "$1\n" if defined $1; }
In reply to RegEx Array by turbo3k
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |