aommaster Posted December 24, 2008 Share Posted December 24, 2008 Hey guys! I would like to have my program read some data from a standard format of strings. Each string has the following format: where xxxxx could be any number of characters, and will (obviously), take the name of a color. Is there any way to quickly extract the xxxxx out of the string, or do I need to use a combination of stringleft, stringright and stringtrim functions? Thanks! Link to comment Share on other sites More sharing options...
Valuater Posted December 24, 2008 Share Posted December 24, 2008 _StringBetween() see help 8) Link to comment Share on other sites More sharing options...
aommaster Posted December 24, 2008 Author Share Posted December 24, 2008 Wow.. you guys have thought of everything Question for you: Is there any way of having this function return the first instance? Or do I have to look up the array produced directly to get that information? Link to comment Share on other sites More sharing options...
Valuater Posted December 24, 2008 Share Posted December 24, 2008 (edited) This gives the 1st result... #include <String.au3> $String = "[color=brown]" $String = _StringBetween($String, "[color=", "]") If IsArray($String) Then MsgBox(0x0, "color", $String[0]) 8) Edited December 24, 2008 by Valuater Link to comment Share on other sites More sharing options...
aommaster Posted December 24, 2008 Author Share Posted December 24, 2008 Haha.. okay.. so I do need to get it out of the array Thank you very much for your help! Link to comment Share on other sites More sharing options...
Valuater Posted December 24, 2008 Share Posted December 24, 2008 Haha.. okay.. so I do need to get it out of the array Thank you very much for your help!Welcome... Merry Xmas!8) Link to comment Share on other sites More sharing options...
aommaster Posted December 24, 2008 Author Share Posted December 24, 2008 Merry Christmas to you too! I got one more problem from this The string I am trying to manipulate is this: Finally, please post a new [color=blue][b]HijackThis[/b][/color] log, and a description of any remaining problems. After previous manipulation the string now looks like this: Finally, please post a new [color=blue]<b>HijackThis</b></span> log, and a description of any remaining problems. I would like to convert: [color=blue] to <span style='color:blue'> So, I used your method with the stringbetween to get the color of the font. I have the whole span style tag ready to be switched, but I'm not sure how to replace the color=blue tag by that string. I was thinking a stringregexpreplace, but I don't want it replace any tags except those with a color statement. Any ideas? Thanks again Link to comment Share on other sites More sharing options...
aommaster Posted December 24, 2008 Author Share Posted December 24, 2008 Nevermind.. figured it out Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now