PatternReplaceStr()

Discuss any general programming issues here
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

PatternReplaceStr()

Post 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!
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5887
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: PatternReplaceStr()

Post 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...
Post Reply