I need to filter out the strings which matches with [LCK_ or OPN_] only at the starting of file name, but not to consider any where else.
Example source strings:
LCK_card_L02NOR19999_2012-11-07-121600 [Invalid/Filter it]
BLTM_L183ROP3289_2012-11-07-121601 [Valid one]
TEMP_LCK_card_L02NOR19999_2012-11-07-121600 [Valid one]
I tried like this:
LCK_|OPN_
But it’s also matching TEMP_LCK_XXXXX.
how do I combine the patterns for my rquriement [ignore LCK_ or OPN_ and extract date]?
My regex pattern for date extraction
(19|20)\\d\\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])[-]\\d\\d\\d\\d\\d\\d]
Consider this code:
This will match first the start of the string (denoted by
^), then anything exceptLCK_orOPN_(denoted by?!), then 0 or more arbitrary characters, then your date pattern, then possibly a number of characters.