line using while
these are my regexes to get date & time (I'm getting empty line - no match):
grep -Eo "([0-9]{1,2})/([a-z]{1,3})/([0-9]{1,4})" <<< "$line"
grep -Eo "(\?<=[0-9]{4}:).+" <<< "$line"
One line of my input:
5.63.153.125 21/May/2021:00:05:43
Can someone please tell me the problem of my script?
It's a good practice to check whether the regex is working at all before going about implementing somewhere. I tried it here and it didn't match anything.
Thanks, I wrote it here first... but on Python syntax 🤦♂ for Bash I should choose PCRE or PCRE2?
Обсуждают сегодня