10-15-2009
Hello, I apologize if the message was unclear.
The problem is: I want to use the following advanced regular expression syntax "(?:)" which represents grouping without backreference.
Related information: From what I read GNU Grep supports the advanced syntax.
Support: I've used "()" which is grouping with backreference.
My goal isn't to solve any particular problem really. I'm new to the unix enviroment and right now I'm trying to learn as much about grep and regular expressions as possible. I understand that the advanced syntax with grep is likely going to be academic only since I would find piping into other programs simpler (sed/awk).
Summary: Can I use the syntax "(?:)" with GNU Grep 2.5.1?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm trying to grep a long ls by looking at the beginning of each filename for example:
Many files begin with yong_ho_free_2005...
Many files begin with yong_ho_2005...
I can't just use "grep yong_ho" otherwise It'll display both files.
So I'm trying to use a regex but my syntax is wrong.
... (2 Replies)
Discussion started by: yongho
2 Replies
2. Shell Programming and Scripting
I am wondering if there is a way via grep and sed to extract a string that is on the 2nd line below a known marker as in this example:
TextRel 203 0 0 "WELL:"
SetPosAbs 1287 -6676
TextRel 210 0 0 "AEP #2"
The marker is WELL:, but the string I need is "AEP #2". Can grep/sed handle this... (19 Replies)
Discussion started by: phudgens
19 Replies
3. Shell Programming and Scripting
I want it to find lines that contain any number of capital letters before P
this is what I have tried
echo "AAAAAP" | grep 'P'
echo "AAAAAP" | grep '\{1\}P'
echo "AAAAAP" | grep '^*P'
But none of them seem to work, any help is much appreciated
thanks
Calypso (4 Replies)
Discussion started by: Calypso
4 Replies
4. UNIX for Dummies Questions & Answers
Hello,
This is my first post so, Hello World! Anyways, I'm learning how to use unix and its quickly become apparent that a strong foundation in regular expressions will make things easier. I'm not sure if my syntax is messing things up or my logic is messing things up.
ps -e | grep... (4 Replies)
Discussion started by: MykC
4 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I'm working on learning regular expressions and what I can do with them. I'm using unix to and its programs to experiment and learn what my limitations are with them.
I'm working on duplicating the regular expression:
^(.*)(\r?\n\1)+$
This is supposed to delete duplicate lines... (2 Replies)
Discussion started by: MykC
2 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I looking to use grep to return a string with exactly n matches.
I'm building off this:
ls -aLl /bin | grep '^.\{9\}x' | tr -s ' '
-rwxr-xr-x 1 root root 632816 Nov 25 2008 vi
-rwxr-xr-x 1 root root 632816 Nov 25 2008 view
-rwxr-xr-x 1 root root 16008 May 25 2008... (7 Replies)
Discussion started by: MykC
7 Replies
7. UNIX for Dummies Questions & Answers
I have a directory I need to grep which consists of numbered sub directories. The sub directory names change daily. A file resides in this main directory that shows which sub directories are FULL backups or INCREMENTAL backups.
My goal is to grep the directory for the word "full" and then... (2 Replies)
Discussion started by: SysAdm2
2 Replies
8. Shell Programming and Scripting
How to match lines that don't contain a patern in regex it self, without using the -v option of grep? (15 Replies)
Discussion started by: vistastar
15 Replies
9. UNIX for Beginners Questions & Answers
Hello guys,
Here i am writing a script in bash to check for a valid URL from a file using regex
This is my input file
http://www.yahoo.commmmmm
http://www.google.com
https://www.gooogle.co
www.test6.co.in
www.gmail.com
www.google.co
htt://www.money.com
http://eeeess.google.com... (2 Replies)
Discussion started by: Meeran Rizvi
2 Replies
10. Shell Programming and Scripting
Dear Team
/app/Appln/logs/
echo Session used server are 'grep -i pid|grep -i session | cut -d'.' -f1 | awk '{print $9}' | sort | uniq'
Output -
lxserver01
lxserver02
lxserver03
When I grep session pid in logs server details I can see above distinct server details but I... (6 Replies)
Discussion started by: skp
6 Replies
LEARN ABOUT XFREE86
zgrep
ZGREP(1) General Commands Manual ZGREP(1)
NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)
ZGREP(1)