help need to write regex in optional condition [Close]

后端 未结 2 374
闹比i
闹比i 2021-01-29 11:26

I have a logfile having contains as below

log=

       Using data from (yyyy/mm/dd): 2011/8/3
       0 files queued for scanning.
       Warning: E:\\tes         


        
2条回答
  •  醉话见心
    2021-01-29 11:52

    One way to handle optional parts is to use regex text (optional part|). The part inside parenthesis will match either "optional part" (which can be a regex on its own) or nothing.

提交回复
热议问题