trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: March 2012

Re: [trinity-devel] Fixing What's This and Tooltip text strings

From: Darrell Anderson <humanreadable@...>
Date: Fri, 30 Mar 2012 07:53:41 -0700 (PDT)
> What kind of tips do you need, exactly?  The perl case
> for the additional <whatsthis>-
> enclosed strings in the XML files is fairly straightforward
> if <whatsthis> is a straight text
> container with no subelements:  just slurp the entire
> file into a single string, run
> 
> $file =~
> s/(\<whatsthis\>.*?\b)KDE(.*?\<\/whatsthis\>)/$1TDE$2/gs;
> 
> across it a few times (running it only once may not catch
> cases where a single whatsthis
> element contains multiple KDEs), and spit the result back
> into the file.  Or something
> like that.  The above will alter freestanding instances
> of "KDE" and those at the beginning
> of another word, but should leave it alone if it's in the
> middle or at the end, and will handle
> the case where the whatsthis element is split across
> multiple lines.  To do a case-
> insensitive replace, add an i right before the semicolon at
> the end of the line.
> 
> I can probably come up with similar stuff for your other two
> cases given a couple of
> samples of each (location in the git repository plus line
> numbers works).

Yes, that example helps. I have a book here to learn perl and I'm reading the book now. I'm learning and conceptually I know what I want to do, but I never have been good with regexes. The example you provided does help and makes sense (I just read about slurping :) ).

I have so much to do but I will get around to testing what you provided. Thank you!

Darrell