Hi,

I have a string,

calendarview.pl?loginid=102138&month=04&year=2003&student_id=&user_typ +e=TUTOR&CalendarName=102138Academic&framename=top.index_main&session_ +number=618280744437303

I would like to replace three parts of the string, the first two should be feasible, I would like to replace '&month=04' and '&year=2003'(where 04 can be any two digits and 2003 can be any four digits) with ''.

However, my third replace is a little more complicated. I would like to replace '&CalendarName=102138Academic' with ''. The poblem is the length of the value of CalendarName (in this case 102138Academic) will vary.

The remaining parameters in the string I would like to leave as they are. The order of the parameters in the string may also vary.

Is the above possible?

Any advice apreciated!


In reply to Replacing parts of a string by spiderbo

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.