in reply to Looking for N/A twice
which is probably way faster than any RegEx method.$str = 'N/A N/A blah blah blah SATA N/A blah blah N/A'; $substr = 'N/A'; if (index($str,$substr, index($str,$substr)+1 ) ) { print "two or more occurrences of '$substr' in '$str'" }
Nobody says perl looks like line-noise any more
kids today don't know what line-noise IS ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Looking for N/A twice
by ambrus (Abbot) on Oct 22, 2007 at 09:07 UTC |