[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

RE: [MacPerl] Wildcard



Check the perl documentation. I am not at my mac right now, but you should
find the docs in shuck.

You are describing Regular Expressions, which perl does very well. Your
example would look like this:

	if($text =~ m/^t/){print....

The ^ anchors the match to the start of the string, which prevents it from
matching "Ma t ch".

Jeffrey Friedl's book Mastering Regular Expressions (O'Reilly) is excellent.
Also, get and read the Camel book, also from O'Reilly)

HTH

-Mark

Mark T. Johns - Unix/Perl/Internet - Faxon, A Dawson Company
        Work                      Home
Email:  mark.johns@dawson.com     mark.johns@usa.net
WWW:    http://38.219.86.21/      http://www.netcom.com/~johnsms/
ICQ:    #15881989                 #17834280


> -----Original Message-----
> From: owner-mac-perl@iis.ee.ethz.ch
> [mailto:owner-mac-perl@iis.ee.ethz.ch]On Behalf Of tboley
> Sent: Wednesday, September 23, 1998 11:02 AM
> To: mac-perl@iis.ee.ethz.ch
> Subject: [MacPerl] Wildcard
>
>
> Hi!
>
> Is there a way to use wildcards in perl? It would be nice if the folowing
> would work:
>
> if ($text eq "t*") {print "$text\n"} # Where * is a wildcard
>
> So the print comand is executed when $text is "tee" or "time" or ...
>
>
>
> Thomas
>
>
> ########################################################################
> #                                                                      #
> # Visit the wild_side! webpages at http://www.uni-bielefel.de/~tboley/ #
> #                                                                      #
> #                               ;-)                                    #
> #                                                                      #
> ########################################################################
>
>
> ***** Want to unsubscribe from this list?
> ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch
>


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch