Jump to content


Photo

choose the day from the date


  • Please log in to reply
6 replies to this topic

#1 ugakebet

ugakebet

    Advanced Member

  • UBot Users
  • PipPipPip
  • 196 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v3.5
  • License:Pro

Posted 12 March 2011 - 10:23 AM

I need to select the day from the current date.
Right now I have (see pic).. but it does not work. How can I use regex to get the dd part from mm/dd/yyyy

Attached Files



#2 Kreatus (Ubot Ninja)

Kreatus (Ubot Ninja)

    Custombotsolutions.com

  • UBot Users
  • PipPipPip
  • 1826 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 12 March 2011 - 12:07 PM

Hi try to replace it with this
\b\w{2}/\w{2}/\w{4}\b


#3 ugakebet

ugakebet

    Advanced Member

  • UBot Users
  • PipPipPip
  • 196 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v3.5
  • License:Pro

Posted 12 March 2011 - 12:54 PM

Hi try to replace it with this

\b\w{2}/\w{2}/\w{4}\b



Hey,
nope it does not work... It simply copies the whole mm/dd/yyyy not the dd portion

#4 Gogetta

Gogetta

    Advanced Member

  • Moderators
  • 581 posts
  • OS:Windows Vista
  • Total Memory:4Gb
  • Framework:v3.5
  • License:Dev

Posted 12 March 2011 - 01:44 PM

Another way you can do this by adding to a list from text and using the slash as the delimiter. Then all you would need to do is use list item position 1.

Posted Image

#5 Kreatus (Ubot Ninja)

Kreatus (Ubot Ninja)

    Custombotsolutions.com

  • UBot Users
  • PipPipPip
  • 1826 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 12 March 2011 - 01:54 PM

Oh I see you want the day only. Try this Attached File  dateonly.ubot   6.54K   14 downloads

#6 ugakebet

ugakebet

    Advanced Member

  • UBot Users
  • PipPipPip
  • 196 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v3.5
  • License:Pro

Posted 13 March 2011 - 01:01 AM

Another way you can do this by adding to a list from text and using the slash as the delimiter. Then all you would need to do is use list item position 1.

Posted Image



Oh I see you want the day only. Try this Attached File  dateonly.ubot   6.54K   14 downloads




thanks guys, both the above should definitely work. But i just find it surprising that regex itself cannot separate the month day or year from a dd/mm/yyyy format. feel for the guys that dont use ubot and simply want to get the month through regex

#7 JohnB

JohnB

    Advanced Member

  • UBot Users
  • PipPipPip
  • 3350 posts
  • LocationNJ
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 13 March 2011 - 07:19 AM

Regex has a search and replace method. If you search the internet you will find a ton of info on it.

John




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users