My desired result is:#!/usr/bin/perl use strict; use warnings; while (<DATA>) { my $one = $1 if /^\{\w+\s+\d+\}([^\s\t]+)/; my $two = $1 if /^\{\w+\s+\d+\}\s+(.*)/; print "ONE: $one\n"; print "TWO: $two\n"; } __DATA__ {STRING 4} 123.122.124.125 some text here
Any ideas what I'm doing wrong. This should work!ONE: {STRING 4} TWO: 123.122.124.125 some text here
In reply to Silly RegEx problem by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |