Sponsored Content
Full Discussion: Regular Expressions
Top Forums Shell Programming and Scripting Regular Expressions Post 302369511 by DavidHe on Sunday 8th of November 2009 11:56:41 PM
Old 11-09-2009
Power Regular Expressions

what elements does " /^[^A-Z]/ " match?

I did the test which indicates that it matches single lowercase character like 'a','b' etc. and '1','2' etc.

But I really confused with that. Because, "/^abc/" matches strings like "abcedf" or "abcddddee".

So, what does caret ^ really mean?
Any response is appreaciated !


Thanks
 

10 More Discussions You Might Find Interesting

1. Programming

regular expressions in c++

How do I use the regular expressions in c++? (2 Replies)
Discussion started by: szzz
2 Replies

2. Shell Programming and Scripting

Help with regular expressions

I have following content in the file CancelPolicyMultiLingual3=U|PC3|EN RestaurantInfoCode1=U|restID1|1 ..... I am trying to use following matching extression \|(+) to get this PC3|EN restID1|1 Obviously it does not work. Any ideas? (13 Replies)
Discussion started by: arushunter
13 Replies

3. UNIX for Dummies Questions & Answers

regular expressions

Hi Gurus, I need help with regular expressions. I want to create a regular expression which will take only alpha-numeric characters for 7 characters long and will throw out an error if longer than that. i tried various combinations but couldn't get it, please help me how to get it guys. ... (2 Replies)
Discussion started by: ragha81
2 Replies

4. Shell Programming and Scripting

regular expressions

Hello, Let say I have a string with content "Free 100%". How can extract only "100" using ksh? I would this machanism to work if instead of "100" there is any kind of combination of numbers(ex. "32", "1238", "1"). I want to get only the digits. I have written something like this: ... (4 Replies)
Discussion started by: whatever
4 Replies

5. UNIX for Advanced & Expert Users

Regular Expressions

Hi, below is a piece of code written by my predecessor at work. I'm kind of a newbie and am trying to figure out all the regular expressions in this piece of code. It is really a tough time for me to figure out all the regular expressions. Please shed some light on the regular expressions... (3 Replies)
Discussion started by: ramky79
3 Replies

6. UNIX for Dummies Questions & Answers

Regular expressions

In regular expressions with grep(or egrep), ^ works if we want something in starting of line..but what if we write ^^^ or ^ for pattern matching??..Hope u all r familiar with regular expressions for pattern matching.. (1 Reply)
Discussion started by: aadi_uni
1 Replies

7. Shell Programming and Scripting

Regular Expressions

#!/usr/bin/perl $word = "one last challenge"; if ( $word =~ /^(\w+).*\s(\w+)$/ ) { print "$1"; print "\n"; print "$2"; } The output shows that "$1" is with result one and "$2" is with result challenge. I am confused about how this pattern match expression works step by step. I... (8 Replies)
Discussion started by: DavidHe
8 Replies

8. Shell Programming and Scripting

Help with regular expressions

I have a file that I'm trying to find all the cases of phone number extensions and deleting them. So input file looks like: abc x93825 def 13234 x52673 hello output looks like: abc def 13234 hello Basically delete lines that have 5 numbers following "x". I tried: x\(4) but it... (7 Replies)
Discussion started by: pxalpine
7 Replies

9. Shell Programming and Scripting

Regular Expressions

I am new to shell scripts.Can u please help me on this req. test_user = "Arun" if echo "test_user is a word" else echo "test_user is not a word" (1 Reply)
Discussion started by: chandrababu
1 Replies

10. Shell Programming and Scripting

Regular expressions

I need to pick a part of string lets stay started with specific character and end with specific character to replace using sed command the line is like this:my audio book 71-skhdfon1dufgjhgf8.wav' I want to move the characters beginning with - end before. I have different files with random... (2 Replies)
Discussion started by: XP_2600
2 Replies
BACKUP_ADDVOLENTRY(8)					       AFS Command Reference					     BACKUP_ADDVOLENTRY(8)

NAME
backup_addvolentry - Defines a volume entry in a volume set SYNOPSIS
backup addvolentry -name <volume set name> -server <machine name> -partition <partition name> -volumes <volume name (regular expression)> [-localauth] [-cell <cell name>] [-help] backup addvole -n <volume set name> -s <machine name> -p <partition name> -v <volume name (regular expression)> [-l] [-c <cell name>] [-h] DESCRIPTION
The backup addvolentry command adds a volume entry definition to the existing volume set named by the -name argument. A volume entry definition can match one or more volumes, depending on the combination of the -server, -partition, and -volumes arguments. For the -server and -partition arguments, provide either o The name of one machine or partition. o The metacharacter expression .* (period and asterisk), which matches every machine name or partition name in the Volume Location Database (VLDB). For the -volumes argument, specify a combination of alphanumeric characters and one or more metacharacters to wildcard part or all of the volume name. OPTIONS lists the acceptable metacharacters. CAUTIONS
It is best to issue this command in interactive mode. If issuing it at the shell prompt, enclose any strings containing metacharacters in double quotes, or escape the metacharacters with other delimiters, to prevent the shell from interpreting them. Adding volume entries to a temporary volume set is possible only within the interactive session in which the volume set was created. OPTIONS
-name <volume set name> Names the volume set to which to add this volume entry definition. The volume set must already exist (use the backup addvolset command to create it). -server <machine name> Defines the set of one or more file server machines that house the volumes in the volume entry. Provide either one fully-qualified hostname (such as "fs1.abc.com") or the metacharacter expression ".*" (period and asterisk), which matches all machine names in the VLDB. -partition <partition name> Defines the set of one or more partitions that house the volumes in the volume entry. Provide either one complete partition name (such as "/vicepa") or the metacharacter expression ".*" (period and asterisk), which matches all partition names. -volumes <volume name> Defines the set of one or more volumes included in the volume entry. Specify the volumes by name, by using any combination of regular alphanumeric characters and one or more of the following metacharacter expressions: . The period matches any single character. * The asterisk matches zero or more instances of the preceding character. Combine it with any other alphanumeric character or metacharacter. [ ] Square brackets around a list of characters match a single instance of any of the characters, but no other characters; for example, "[abc]" matches a single "a" or "b" or "c", but not "d" or "A". This expression can be combined with the asterisk. ^ The caret, when used as the first character in a square-bracketed set, designates a match with any single character except the characters that follow it; for example, "[^a]" matches any single character except lowercase "a". This expression can be combined with the asterisk. A backslash preceding any of the metacharacters in this list makes it match its literal value only. For example, the expression "." (backslash and period) matches a single period, "*" a single asterisk, and "\" a single backslash. Such expressions can be combined with the asterisk (for example, ".*" matches any number of periods). Perhaps the most common metacharacter expression is the period followed by an asterisk (".*"). This expression matches any string of any length, because the period matches any character and the asterisk means any number of that character. As mentioned, it is the only acceptable metacharacter expression for the -server and -partition arguments. In a volume definition it can stand alone (in which case it matches every volume listed in the VLDB), or can combine with regular characters. The following example matches any volume name that begins with the string "user" and ends with "backup": user.*backup -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The backup command interpreter presents it to the Backup Server, Volume Server and VL Server during mutual authentication. Do not combine this flag with the -cell argument. For more details, see backup(8). -cell <cell name> Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see backup(8). -help Prints the online help for this command. All other valid options are ignored. EXAMPLES
The following command adds a volume entry to the volume set called "sys". The entry matches all volumes on any machine or partition whose names begin with the string "sun4x_56" followed by a period: backup> addvolentry sys .* .* sun4x_56..* The following command adds a volume entry to the volume set called "fs2", to match all volumes on the /vicepb partition of file server machine "fs2.abc.com". Because it is issued at the shell prompt, double quotes surround the metacharacters in the -volumes argument. (The command is shown here on two lines only for legibility reasons.) % backup addvolentry -name fs2 -server fs2.abc.com -partition /vicepb -volumes ".*" The chapter in the OpenAFS Administration Guide about configuring the AFS Backup System presents additional examples as well as advice on grouping volumes. PRIVILEGE REQUIRED
The issuer must be listed in the /etc/openafs/server/UserList file on every machine where the Backup Server is running, or must be logged onto a server machine as the local superuser "root" if the -localauth flag is included. SEE ALSO
backup(8), backup_addvolset(8), backup_delvolentry(8), backup_delvolset(8), backup_listvolsets(8) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 BACKUP_ADDVOLENTRY(8)
All times are GMT -4. The time now is 06:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy