CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Regular Expressions:
Simple question about [^\]]*



Feb 5, 2001, 8:01 AM

Post #1 of 2 (3658 views)
Simple question about [^\]]* Can't Post


I try to get the shortest match for exp. a pair of brackets. Normally
It is the longest match and
I read somewhere that I don't have to write all the time the stuff
with the [^regexp] to get the shortest match and that there is a qualifier
to instruct perl to get the shortest match


Enthusiast / Moderator

Feb 5, 2001, 10:31 AM

Post #2 of 2 (3656 views)
Re: Simple question about [^\]]* [In reply to] Can't Post

It sounds like you want to use .*? instead of .*. This isn't specifically the shortest match possible, it's the left-most shortest match possible.

Jeff "japhy" Pinyan -- accomplished hacker, teacher, lecturer, and author


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives