简体   繁体   中英

Remove date from text file with notepad++

I have a question about removing date and time from a text file with notepad++ .

I tried with this RegEx but still not working

\d{2}-\d{2}-\d{4}   \d{2}:\d{2}

The dates are like that:

04-21-1991  9:09    
04-21-1991  9:09    
04-21-1991  17:08   
04-21-1991  17:08   
04-22-1991  7:35    
04-22-1991  7:35    
04-22-1991  13:40   

{2} means exactly 2

You should try this:

\d{2}-\d{2}-\d{4}  \d{1,2}:\d{2}

You have two mistakes in your regex, it looks like. The first is that the regex is looking for one more space than exists in the data. The second is that you're looking for "exactly two digits" for the hour, you want "one or two."

\d{2}-\d{2}-\d{4}  \d{1,2}:\d{2}

http://www.regexpal.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM