I have three string samples below:
day/Mon/done
day/Tue/done
day/Wed/done
How do I extract day/Wed/done
using negation for the other two? Below doesn't work.
/day/[^(Mon|Tue)]/done
I have three string samples below:
day/Mon/done
day/Tue/done
day/Wed/done
How do I extract day/Wed/done
using negation for the other two? Below doesn't work.
/day/[^(Mon|Tue)]/done
It's not how negated character classes work -- they still interpret each character inside the [..]
as a single character. And there is no match for
day/?/done
where ?
is only one character. Either use any of the techniques in Regular expression to match a line that doesn't contain a word? (thanks, Peter!), or make good use of the fact that the first character for these days are unique:
day/[^MT]../done