Topic
1 reply Latest Post - ‏2013-02-12T09:17:12Z by SystemAdmin
SystemAdmin
SystemAdmin
603 Posts
ACCEPTED ANSWER

Pinned topic Aql Text analytics regular expression

‏2013-02-12T06:14:12Z |
Hi

i am trying to extact date view from a text file which contains following dates and some text.

22/11/2008
23/12/2009
24/12/2007

i was unable to generate regular expression using regular expression generator. it is giving me some regular expression but eclipse showing me some error.Below is my code

create view Date as
extract regex /\d\d(/)\d\d(/)\d\d\d\d/
on R.text as match
from Document R;
output view Date;

error is at line 2, can u help how to write regular expression for 22/11/2008 kind of dates
Updated on 2013-02-12T09:17:12Z at 2013-02-12T09:17:12Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    603 Posts
    ACCEPTED ANSWER

    Re: Aql Text analytics regular expression

    ‏2013-02-12T09:17:12Z  in response to SystemAdmin
    Hi,

    Try this regex "/((\d{2})|(\d))\/((\d{2})|(\d))\/((\d{4})|(\d{2}))/". Its general expression for date of format dd/mm/yyyy.