in reply to Re: RegEx Perl Newbie Question
in thread RegEx Perl Newbie Question

(I'd link to it, but Perlmonks' link syntax does not play nicely with fragments that contain square brackets.)

Here’s what I do: copy-and-paste the link from the browser’s address bar:

http://perldoc.perl.org/perlfaq4.html#How-can-I-split-a-%5bcharacter%5 +d-delimited-string-except-when-inside-%5bcharacter%5d%3f

apply a few edits:

[doc://perlfaq4#How-can-I-split-a-%5bcharacter%5d-delimited-string-exc +ept-when-inside-%5bcharacter%5d%3f]

and voilà:  How can I split a [character] delimited string except when inside [character]?

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^3: RegEx Perl Newbie Question (pmbk)
by Anonymous Monk on Aug 19, 2014 at 05:24 UTC

      Well, it works fine for me in Google Chrome, so I didn’t think to test it in other browsers. :-(

      Works fine also in Internet Explorer 11, but in Firefox 31.0 it just takes me to perlfaq4. I’m not sure if that qualifies as a broken link, so I’m guessing you are using yet another browser?

      Thanks for the link. I don’t know what “pmbk” refers to (and Messrs. Google and Super Search have left me none the wiser).

      Update: Corion suggests “pmbk” may mean “PerlMonks bookmark”, referring to the JavaScript snippet. Makes sense.

      Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

        Like I said, doc:// is peculiar, it spits out  <p>and <i>voil&agrave;:</i>&nbsp;&nbsp;<a href="http://perldoc.perl.org/perlfaq4.html#How-can-I-split-a-%255bcharacter%255d-delimited-string-except-when-inside-%255bcharacter%255d%253f">How can I split a &#91;character&#93; delimited string except when inside &#91;character&#93;?</a></p>

        Where as you typed

        <p>and <i>voil&agrave;:</i>&nbsp;&nbsp;[doc://perlfaq4#How-can-I-split +-a-%5bcharacter%5d-delimited-string-except-when-inside-%5bcharacter%5 +d%3f]</p>

        So its a quirk of doc://, probably why I avoid doc://

Re^3: RegEx Perl Newbie Question
by AppleFritter (Vicar) on Aug 19, 2014 at 07:40 UTC
    Neat, thanks! I'd tried the HTML entities the Monastery usually requires for literal square brackets (which did not work), but for some reason I'd not thought of using percent-encoding. Another trick learned! (And who says you can't teach an old pony new tricks?)