
Laurent_R
Veteran
/ Moderator
Nov 15, 2014, 5:33 AM
Post #5 of 5
(35255 views)
|
Re: [jonjon] Extracting String that is contained in Double Quotes, Single Quotes and there can be Quotes within Quotes
[In reply to]
|
Can't Post
|
|
If you want to capture several items, you can do it in a list context, as in this example under the Perl debugger:
DB<1> $_ = 'If [Jon is Great] = "01/31/20XX" then "January" ' DB<2> @matches = /"(.*?)"/g; DB<3> x \@matches; 0 ARRAY(0x600500ae8) 0 '01/31/20XX' 1 'January' DB<4> Having said that, I agree with Bill that the module Regexp::Common qw(balanced) is most probably a better solution.
|