n9mfk9 Posted July 12, 2007 Share Posted July 12, 2007 Hi All I have a sting with the date 5/20/2007 the date changes so what wood be the best way to do a string replace based on the format i tried using * it did not work thanks beau Link to comment Share on other sites More sharing options...
mikehunt114 Posted July 12, 2007 Share Posted July 12, 2007 You need to be more specific. What is your goal? What code have you tried? Perhaps a StringBetween and then a StringReplace would work. IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
n9mfk9 Posted July 12, 2007 Author Share Posted July 12, 2007 I have a date I cold be any date the / are the only part that does not change is there a way to wilcard a sting replace / / Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 12, 2007 Moderators Share Posted July 12, 2007 (edited) I have a date I cold be any datethe / are the only part that does not changeis there a way to wilcard a sting replace / /You are making no sense.Why don't you show the an example of what you are doing or want to do.Edit:I should say this... and maybe since you're not making sense to me, the help file will make sense to you... you can use wild cards with "string" replacement by using StringRegExpReplace().That's about as much help as anyone could give you with what you've provided to help you thus far... Kind of like going to the doctor for a vasectomy and walking out a unich ... Both give you the result you wanted, but not what you had in mind Edited July 12, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
n9mfk9 Posted July 12, 2007 Author Share Posted July 12, 2007 here is wthat i wet to replace Created on: 7/11/2007 but the date changes by the day so tomorrow it cold be 8/11/2006 so what would i look for Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 12, 2007 Moderators Share Posted July 12, 2007 StringRegExpReplace($sString, 'Created on: \d{1,2}\/\d{1,2}\/\d{4}', 'Created on: ' & @MON & '\/' & @MDAY & '\/' & @YEAR) If that doesn't work, then you need to provide ALOT more... we don't even know how in the hell you're using this. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
someone Posted July 12, 2007 Share Posted July 12, 2007 (edited) Your still not making a ton of sense... but both Mike and SmOke N have given you a very good answer of StringRegExpReplace(). I'm sure if you search around the forum for date and StringRegExp(with or without the replace) you'll come up with good examples... EDIT: hmm in the amount of time it took me to respond, SmOke came in, figured out the correct stringregexpreplace syntax, posted it, and left... hmm... not... good Edited July 12, 2007 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 12, 2007 Share Posted July 12, 2007 how to replace a date?Ask her sister out...?I have a sting with the dateYou will if she hears you asking her sister out! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
n9mfk9 Posted July 12, 2007 Author Share Posted July 12, 2007 StringRegExpReplace($sString, 'Created on: \d{1,2}\/\d{1,2}\/\d{4}', 'Created on: ' & @MON & '\/' & @MDAY & '\/' & @YEAR) If that doesn't work, then you need to provide ALOT more... we don't even know how in the hell you're using this. Thanks that worked I have a ? if i had two line of text that were the same is there a way to have StringRegExpReplace replace only the scent line thanks Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 12, 2007 Moderators Share Posted July 12, 2007 Thanks that worked I have a ? if i had two line of text that were the same is there a way to have StringRegExpReplace replace only the scent line thanksTurtles Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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