Jon Shoberg wrote:
>
> I have a list/database of words that follows as ...
>
> Top
> ...
> Top/Arts/Food
> Top/Arts/Food/Country
> ...
> Top/World/America
> Top/World/Japan
> Top/World/Japan/Economy
> Top/World/Japan/Food
> Top/World/Japan/Food/Country
> Top/World/Japan/Food/Country/By_Chef
>
> ...
>
> How can I setup a regexp query/filter such that I can choose the prefix and
> the number of "/" in the results?
>
> Example: How can I query/filter the list such that I am looking for all
> "Top/World/" matches that have only one more word after them.
$_ = 'Top/World/Japan';
if ( m-^/Top/World/[^/]+$- ) {
> So my only
> results from the example about would be "Top/World/America" and
> "Top/World/Japan". Then I would do the same for "Top/World/Japan" and get
> "Top/World/Japan/Economy" and then "Top/World/Japan/Food". This is part of
> the program so I can count the number of "/" in the query/filter string.
$_ = 'Top/World/Japan/Food/Country/By_Chef';
my $count_slashes = tr-/--;
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]