Jump to content
gcue

stringregexp to extract date from a string

Recommended Posts

gcue

hello world

instead of using stringsplit, i am trying to see if there's a way to use stringregexp to extract date from a string

$string = "12/21/2013 01:32:22 PM"

I would like to keep "12/21/2013"

thanks in advance!

Share this post


Link to post
Share on other sites
TheDcoder

 

thanks in advance!

Hey, Thats my style :)

I am trying to learn regexp pattern's from here, Hope it Helps :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
gcue

perfect

thank you!

Share this post


Link to post
Share on other sites
kylomas

or

$string = "12/21/2013 01:32:22 PM"
ConsoleWrite(stringsplit($string,' ',2)[0] & @LF)

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
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

×