Hi,

In fact I never understood very well this part of the regex: please supose I have these 3 different lines in array for instance:

1) func1(parameter1,"ok...", var1)

2)#define "this is my name"

3) "hi"

I want to substitute the data between strings in different manner for each case. There are several almost common cases. If I create a regex for the first, how can I create a second, for the 2nd line and 3th, excluding the word function func1, for instance? The exclusion of an entire word, not just characters, all ways made me confused. And it might not be at the beggining of a sentence. I saw solutions like (?!word) that don't work... Any guidance would be apreciated...

Kepler


In reply to String replace - Part II by kepler

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.