Timeline for egrep matching lines that shouldn't match
Current License: CC BY-SA 4.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 24, 2021 at 14:59 | comment | added | ilkkachu | And in default Zsh, or in Bash with failglob set, the second will error out, so better just quote everything that looks like a shell glob. Also, the ERE [A-Za-z0-9\ ,] will match a backslash too. In the first command here egrep does see it because it's quoted. | |
| Mar 24, 2021 at 14:52 | comment | added | RalfFriedl | Yes, you can rewrite the regex to not need a backslash. Note also that space doesn't require a backslash, whether in a character set or outside. But it is needed to prevent the shell from splitting the regex. Just use single quotes unless you are sure you don't need them. | |
| Mar 24, 2021 at 14:47 | comment | added | dumbledad | Thanks! The other solution I just found was to include the dot as the only option, as it does not need escaping inside option brackets, i.e. ^[A-Za-z0-9\ ,]+[.]1 | |
| Mar 24, 2021 at 14:41 | history | answered | RalfFriedl | CC BY-SA 4.0 |