At 19:14 +0100 5/2/09, John Delacour wrote:
>#!/usr/bin/perl
>my $word = "something";
>while (<>) { /$word/ or print }
Noting is ever simple.
That would need modification to handle the case there the letters constituting
$word appear within another "word" that has more characters than $word.
while (<>) { /\W$word\W/ or print }
Is a start requiring that $word be surrounded by two non-word characters but
will fail when $word begins or ends a line.
There's also the problem that perl's definition of a word character includes
programming conventions, particularly the underscore.
BBEdit probably does a better job of understanding the OP's actual desires.
What if he actually wants to include hyphenated instances which include -\n ?
--
--> From the U S of A, the only socialist country that refuses to admit it. <--
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or
confirmed) problem with the software, please email to "[email protected]"
rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---