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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



sterni
Deleted

Feb 5, 2001, 8:01 AM

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

Hi!

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

*i



japhy
Enthusiast / Moderator

Feb 5, 2001, 10:31 AM

Post #2 of 2 (1058 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