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: Re: [jonjon] Extracting String that is contained in Double Quotes, Single Quotes and there can be Quotes within Quotes: Edit Log



Zhris
Enthusiast

Nov 13, 2014, 10:01 AM


Views: 39526
Re: [jonjon] Extracting String that is contained in Double Quotes, Single Quotes and there can be Quotes within Quotes

Hi,

Regular expression quantifiers are greedy by default i.e. they will match as much as possible. You can force quantifiers to be ungreedy by following them with a question mark i.e. they will match as little as possible:


Code
["|'](.*?)["|']


Chris


(This post was edited by Zhris on Nov 13, 2014, 10:04 AM)


Edit Log:
Post edited by Zhris (Enthusiast) on Nov 13, 2014, 10:04 AM


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

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