Hi,

I'm really at a dead end with this :(

Here is an example variable ($test_string);

my $test_string = q| [lien "http://www.domain.com"][img]http://www.domain.com/image.gi +f[/img][/lien] Si qqn connait un transporteur ou une agence qui fais des bon prix [lien "http://www.smileycentral.com/?partner=ZSzeb001"][img]http://smi +leys.smileycentral.com/cat/12/12_1_220.gif[/img][/lien] pour l'australie je suis preneur merci............... BONNE ANNÉE [signature]|;


Now, what I need to do, is get rid of the lien .. /lien around that code. I've been trying for ages to simply get code that will work .. this:

while ($test_string =~ m%\[img\]([0-9a-zA-Z\"\?\%\:\/\_\-\.\=]+)\[/img\]%gix) {

..works fine (and grabs the image URL's fine).

However, when doing something like:

while ($test_string =~ m%\[lien "([0-9a-zA-Z\"\?\%\:\/\_\-\.\=]+)"\]\[img\]([0-9a-zA-Z\"\?\%\:\/\_\-\.\=]+)\[/img\]%gix) {

..it simply refuses to match at all.

Can anyone suggest where I'm going wrong, or better yet - a simpler way to get rid of the lien stuff from around [img tags?

TIA!

Andy

In reply to BBCodes, removing [URL's by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.