Jump to content

how to replace a date?


Recommended Posts

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

  • Moderators

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

/ /

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 :whistle:

Edited 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

  • Moderators

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

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 by someone
While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd
Link to comment
Share on other sites

how to replace a date?

Ask her sister out...?

I have a sting with the date

You will if she hears you asking her sister out!

:whistle:

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

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

  • Moderators

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

Turtles

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...