in reply to regex: finding something followed explicitly by a dot
Or possibly: grep 'LEAD_TYPE\.' SearchSet.java#! /usr/bin/env perl use strict; use warnings; BEGIN { die "usage: $0 <file> <word>" unless @ARGV==2 } sub file_has_word { my ($fn, $w) = @_; open my $f, $fn or die "$fn: $!"; local $/ = undef; # but why do you want this? return unless <$f> =~ /\Q$w/; 1 } print "found it!\n" if file_has_word(@ARGV);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex: finding something followed explicitly by a dot
by shenme (Priest) on Feb 12, 2006 at 15:29 UTC | |
by ayrnieu (Beadle) on Feb 12, 2006 at 21:27 UTC |