Page 1 of 1

PatternReplaceStr()

Posted: Sat Mar 14, 2015 12:35 am
by djrikki
Hi,

Now PatternReplaceStr() seems like a very powerful string manipulation command, however I cannot grasp how to use it, seems very complicated to say the list! Now I'd love to use it for some syntax highlighting and it looks like a likely candidate for what I am trying to achieve. So if we look at some .xml.

Code: Select all

<Item id="application-www" Notify="selected" Userdata="http://">Application Name website</Item>
Now in Codebench, default text colour is Red, text inside the container group; in this case 'Application Name website' is shown in Black and class properties (i.e. values surrounded by quotation marks) are shown in Purple. Now there must be a way to parse each liine, inserting relevant \27P[xxxxxx] codes before and after pattern matches.

But like I said at the beginning this is all very confusing to me!

Re: PatternReplaceStr()

Posted: Mon Mar 16, 2015 4:04 pm
by airsoftsoftwair
I don't think PatternReplaceStr() could be used here because the XML could come in all kinds of different layouts. I think you're better off parsing this manually...