#!/usr/bin/perl -- use strict; use warnings; use URI(); use CGI(); use URI::QueryParam(); $_ = <<'__STRING__'; <value>javascript:var x=window.open('http://v3vi.click4assistance.co.u +k/c4a.aspx?AccNo=Inter12109&amp;IDENT=US-x&amp;Target=General&amp;Cou +ntry=Singapore','_blank','menubar=no,location=no,resizable=yes,scroll +bars=no,status=no');</value></item> __STRING__ print "$_\n"; if( /^(.*?window.open\(')([^']+)('.*)/mg ){ my( $pre, $uri, $post ) = ( $1, $2, $3 ); $uri = URI->new( CGI->unescapeHTML( $uri) ); $uri->query_param(IDENT => 'UK-x'); $uri->query_param(Country => 'Cheddar'); print $pre, CGI->escapeHTML($uri),$post,"\n"; } __END__ <value>javascript:var x=window.open('http://v3vi.click4assistance.co.u +k/c4a.aspx?AccNo=Inter12109&amp;IDENT=US-x&amp;Target=General&amp;Cou +ntry=Singapore','_blank','menubar=no,location=no,resizable=yes,scroll +bars=no,status=no');</value></item> <value>javascript:var x=window.open('http://v3vi.click4assistance.co.u +k/c4a.aspx?AccNo=Inter12109&amp;IDENT=UK-x&amp;Target=General&amp;Cou +ntry=Cheddar','_blank','menubar=no,location=no,resizable=yes,scrollba +rs=no,status=no');</value></item>

In reply to Re: regex issue by Anonymous Monk
in thread regex issue by rahulgsp83

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.