Timeline for Help with grep pattern for 5-letter word filter in Unix assignment
Current License: CC BY-SA 4.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 17, 2022 at 23:06 | comment | added | Chris Davies | English can very occasionally include characters such æ and ï | |
| Jul 17, 2022 at 21:00 | history | edited | G-Man Says 'Reinstate Monica' | CC BY-SA 4.0 |
Fixed typos; tweaked formatting and wording.
|
| Dec 11, 2021 at 18:56 | comment | added | icarus |
@EdMorton Given that this is a question which is about matching things in /usr/share/dict/words, is for a unix course, and the answer is more complex than anything that has been done before, I believe that you don't want to overthink the answer. For example I didn't worry about setting the locale. Using [[:alnum:]] might mean using characters that are alphabetic but not used in english, for example Thai.
|
|
| Dec 11, 2021 at 15:35 | comment | added | Ed Morton |
The question says The rest of the characters can be any character that occur in english words so those shouldn't be .s in the regexp as those would match punctuation characters like ; or a literal period, .. Maybe each . in the regexp should be [[:alnum:]_-] given the OPs further definition of i.e, uppercase, lowercase, hyphen, numbers, etc. though idk what else etc. might be intended to include.
|
|
| Dec 8, 2021 at 20:52 | comment | added | ctrl-alt-delor | You have to practice this yourself. There are good regex tools out there. Including some on-line ones. Play with them, practice, learn. | |
| Dec 8, 2021 at 20:08 | comment | added | Stéphane Chazelas |
Using -w would be more portable than using \<, >, however note that there is a word boundary between - and a in minus-altus for instance (IOW, the definition of word character is not the same between grep's -w/\</\> and the OP's).
|
|
| Dec 8, 2021 at 19:57 | comment | added | Vordt | I'd forgot to add brackets on that specific instance. I was trying everything I could think of. | |
| Dec 8, 2021 at 19:55 | comment | added | icarus | "too big" I can understand, "too small" puzzles me. | |
| Dec 8, 2021 at 19:53 | vote | accept | Vordt | ||
| Dec 8, 2021 at 19:53 | comment | added | Vordt | That worked! Thank you so much! I knew I was missing something like that, I'd been using ^ to start a line but hadn't used $ and ended up getting words that were too big or too small. | |
| Dec 8, 2021 at 19:52 | history | answered | icarus | CC BY-SA 4.0 |