Timeline for How to highlight the matched regex pattern got by many regex exps disjoined with `||` in awk?
Current License: CC BY-SA 4.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 29, 2024 at 23:32 | comment | added | Ed Morton |
Regarding "&& can't be used directly in match" - right, there's no && in regexps and the 2nd arg to match() is a regexp, not a compound condition. Regarding "I just want the behavior same as grep" - it's not obvious exactly what that statement means but I'm glad you got an answer you're happy with.
|
|
| Dec 29, 2024 at 13:48 | comment | added | An5Drama |
1. Sorry for my inconsistency. I added one sample demonstration. You can just use that and ignore those inconsistency. Anyway, I want to emphasize && can't be used directly in match. If !/bar/ or !/foo bar/ confused you, sorry for that. 2. "at other times still it sounds like you only want to highlight the part": Actually I just want the behavior same as grep, i.e. only highlighting the matched pattern. Sorry for not saying that explicitly.
|
|
| Dec 29, 2024 at 11:08 | history | edited | Ed Morton | CC BY-SA 4.0 |
added 222 characters in body
|
| Dec 29, 2024 at 11:00 | history | answered | Ed Morton | CC BY-SA 4.0 |