in reply to Re^3: Extract delimited words from string
in thread Extract delimited words from string

First of all that's great. Thanks! Those old modules often have uncommon documentation.

Just wanna note that this is answering a third interpretation of the question.

Probably Text::Balanced can handle all of those?

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^5: Extract delimited words from string
by atcroft (Abbot) on Dec 09, 2022 at 00:36 UTC

    Simple enough-the extract_multiple() function can apply multiple functions or regular expressions to do so. Changing the extract_multiple() line to the following:
    @extracted = extract_multiple( $str, [ \&extract_quotelike, qr/\s+/, ], );
    results in the following output:

    Input: 50 0 "R0 G255 B0 A255" "Solid" 118 1 "R0 G0 B0 A255" "R0 G0 B0 + A255" 0 Output: 50 0 "R0 G255 B0 A255" "Solid" 118 1 "R0 G0 B0 A255" "R0 G0 B0 A255" 0 Input: 70 0 "R0 G255 B255 A255" "Solid" 118 1 "R12 G12 B12 A255" "R12 + G12 B12 A255" 0 Output: 70 0 "R0 G255 B255 A255" "Solid" 118 1 "R12 G12 B12 A255" "R12 G12 B12 A255" 0

    (My original code was just extracting based on the quotation marks as delimiters.)

    Hope that helps.