#! /usr/bin/perl -w use strict; use warnings; while (<DATA>) { if (/^If(f?)\b/) { if ($1) { print "found Iff\n"; } else { print "found If\n"; } } else { print "no If\n"; } } __DATA__ If and only iff Iff this were the end the end last If Iffy code or what
In reply to Re: regex problem
by inman
in thread regex problem
by mosh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |