Jump to content

This is probably similar to other recent problems....


Guest jkcavenaugh
 Share

Recommended Posts

Guest jkcavenaugh

you guys all stink... Today I have to install W2K pro on some EVO workstations, and I'm finding that I'm not really excited about it anymore... just want to get home and mess with Linux more... thanks a lot! ;)

 

Is the book Mastering Regular Expressions by Jeffrey Friedl as much worth buying as my instructor stated?

Link to comment
Share on other sites

:lol: :lol: That's funny. I've only ran Win98 and WinME until 2 weeks ago I installed W2kPro and I'm excited about it :wink: :lol: :lol: ...seriously I am.....I get to run Object Desktop with WindowFX and others, and get all the cool font effects, animations, shadowing, and more.....I'm having fun! I haven't booted to a Linux yet :lol: [i duck and run for cover]....

 

...but yes, linux is addictive, consumming your thoughts every waking moment til one day you wake up (from your 3 hour death sleep) to find you have long hair, a beard, bags under your eyes, a 2 foot tall yard, and if you have kids they're a foot taller :mystilol:

 

...be careful!!! :wink:

Link to comment
Share on other sites

Guest jkcavenaugh

as far as microscum OS's are concerned, I love W2k... I've managed as many as 3000 desktops singlehandedly.... Active Dircetory group policy is a wonderful thing... is there such an animal in the Unix world? I'm guessing the only way to creating groups of settings with multiple workstations (or servers for that matter) is to copy shell scripts to each machine, no?

Link to comment
Share on other sites

as far as microscum OS's are concerned, I love W2k... I've managed as many as 3000 desktops singlehandedly.... Active Dircetory group policy is a wonderful thing... is there such an animal in the Unix world?  I'm guessing the only way to creating groups of settings with multiple workstations (or servers for that matter) is to copy shell scripts to each machine, no?

 

Microscums!! Excellent!! YOu are learning!!

 

Other phrses include M$ Micro$oft, Windex, Winblows, Whinedows, Internet Exploder.

 

Lol i am crazy! Maybe it's because i've been playing CS on Windows the last 2 days. Must get back to linux again!!!

 

James

Link to comment
Share on other sites

For the book, I can't make the decision for you, but IMHO, there's not that much to regular expressions. They look complicated and strange, but really, it's not really that hard. In short:

- . is any character (except inside square-brackets).

- * means 0 or more times what is just before (except inside square-brackets) (* is not standalone in regular expressions, as it is on shell substitution).

- ? means 0 or 1 time what is just before (except inside square-brackets) (not standalone).

- + means 1 or more times what is just before (except inside square-brackets) (not standalone).

- {a,b} means between a and b (inclusive) times what is just before (except inside square-brackets).

- ^ means start of line (except inside square-brackets).

- $ means end of line (except inside square-brackets).

- / often is the delimiter for the end of the regular expression.

- [azer] means either 'a' or 'z' or 'e' or 'r'.

- [a-zA-Z] is for ranges, here a to z and A to Z.

- [^qsdf] means neither 'q' nor 's' nor 'd' nor 'f'.

- [:category:] can be used inside square-brackets for designing a category, eg: [[:letter:][:space:]-_] means either a letter or a blank or a dash or an underscore.

- any above special character with a before is this character, eg: .*?[} stands for ".*?[}".

- other characters are themselves, eg: d(jfk|sl stands for "d(jfk|sl".

- some normal characters can be given a special meaning with a preceding (sort of the opposite effect as before), eg:

- ( and ) are for grouping (and post-referencing, with a 1 to 9 numbering in the appearing order).

- | is for alternatives.

 

Now a practical example with sed's syntax (s/X/Y/p means replace X with Y, and then Print):

s/^.*"http://([^/"]+)/?([^"?]*)??([^"]*)".*$/- location "/2" has been viewed on server "1" with parameters "3"./p

This expression should take all lines with "http://server/location?parameters" references (a HTML page for example) and print sentences like:

- location "posting.php" has been viewed on server "mandrakeusers.org" with parameters "mode=reply&t=8079".

 

I did not test, though, and you should remember that depending on the tool you use (sed, awk, grep, text editors...), and sometimes also the OS, the on some characters (mostly parenthesis) may have the effect to eigher specialize or un-specialize this character.

 

Yves.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...