LinuxLinks.com
Newbies What Next ? News Forums Calendar

Search





News Sections
Home
General News (3972/0)
Reviews (626/0)
Press Releases (464/0)
Distributions (187/0)
Software (807/0)
Hardware (522/0)
Security (192/0)
Tutorials (337/0)
Off Topic (180/0)


User Functions
Username:

Password:

Don't have an account yet? Sign up as a New User


Events
There are no upcoming events



CLI Magic: Regular expressions and metacharacters   
Wednesday, August 03 2005 @ 03:45 AM EDT
Contributed by: glosser

Linux.com brings us the next segment of their Command-Line-Interface series.

Most of us probably use regular expressions -- pattern that describes a set of characters -- every day without realizing it. Chances are, however, that you aren't really using them to their full potential.

Consider how you search a file for a word. You probably type something like:

grep expression *.html

This command searches all files in the current directory for the word "expression." This is the simplest form of regular expression: a search for literal characters, which are the letters, numbers, and spaces that make up the search strings. "a", "cat", and "sat on the mat" are all patterns of literal characters.

It's not just grep than uses regular expressions. Most Linux filters (such as sed) use regular expressions, as well as many programming languages, including Perl, JavaScript, and (dare I say it) VBScript.

Full tutorial

  [ Views: 1529 ]  


CLI Magic: Regular expressions and metacharacters | 0 comments | Create New Account
The following comments are owned by whoever posted them. This site is not responsible for what they say.
No user comments.


What's Related
  • Full tutorial
  • More by glosser
  • More from Tutorials


  • Story Options
  • Mail Story to a Friend
  • Printable Story Format


  • We have written a range of guides highlighting excellent free books for popular programming languages. Check out the following guides: C, C++, C#, Java, JavaScript, CoffeeScript, HTML, Python, Ruby, Perl, Haskell, PHP, Lisp, R, Prolog, Scala, Scheme, and SQL.

    Built with GeekLog and phpBB
    Comments to the webmaster are welcome
    Copyright 2009 LinuxLinks.com - All rights reserved