User Tools

Site Tools


journal:spring2019:jgallahe:week7

unix week7


MONTH Day, YEAR

Regular Expressions:
(regex)
often done in vim, grep, sed

Basic RE:

$ - match end of the line

\? - (?) - match 0 or 1 of previous

. - match any single symbol

* - match 0 or more of the previous

[] - char class, match any one of enclosed

[^] - inverted char class, do not match any one of enclosed

\< - match start of the word

\> - match end of the word

Extended RE:

often done in vim, egrep, sed

\+ (+) - one or more of the previous

() - group

\(\) - regex group

Commands:

fgrep - fast grep, only matches a string, no expressions

sed - on command line text editor

awk - more powerful expressions, used to manip data

Playing with expressions:

lab46:/usr/share/dict$ cat words | egrep '^(..)+$' | wc -l 51248

lab46:/usr/share/dict$ cat words | egrep '(^.*[i][n][g]$)|(^.*[e][d]$)' | wc -l or egrep '(ed|ing)$' 13474

lab46:/usr/share/dict$ cat words | grep '^…*[mMg]…$' | wc -l 4321

lab46:/usr/share/dict$ cat words | grep '^..[^rstlne].' | wc -l 56127

lab46:/usr/share/dict$ cat words | grep '^.[aeiouy].[aeiouy].$' | wc -l 1758

lab46:/usr/share/dict$ cat words | grep '^…..$' | wc -l 6806


This week we worked on wpa0. And let me say this has 100% been the most challenging project for me yet. As I write this I am still trying to figure out some of the things that I need to change for this project to be completed. This one, even though some of the challenges is self-induced, has really kicked my butt. I try one thing after another, and it seems I am spinning my wheels. I hope this cool idea I had comes out in the end because right now I can't see the finish line.

~Josh

journal/spring2019/jgallahe/week7.txt · Last modified: 2019/03/13 22:41 by jgallahe