0
votes
1answer
104 views

Sieve: filter subject with regex, file into mailbox named match

I am trying to filter mails by subject with a regular expression. The subjects I want to match are read like [git-foo] some more text where foo is the string I want to check for. I end up with the ...
0
votes
1answer
47 views

Invalidating email addresses from sql dump before import

Synopsis I would like to import production data into the development environment so testing can be done in an almost accurate way. Of course I need to invalidate e-mail addresses as I don't want ...
1
vote
2answers
105 views

The meaning of * in Basic regex versus Extended regex

I thought * meant zero or more of the character or class that precedes it in basic or extended regex. Why does echo hello| grep '*llo' fail but echo hello |egrep '*llo' succeed?
0
votes
1answer
159 views

Regex matching specific details if first match exists, multiline

I'm struggling to get the correct regex to match specifically 'Contact' and 'User-Agent' only if the 'Contact' address matches 10.0.x.x in ~70GB of SIP messages. The SIP message will always contain a ...
18
votes
1answer
446 views

Why bracket a single letter in a grep regex?

I've seen several instances where people are doing this: grep [f]oobar But I don't understand why that is preferable to grep foobar
6
votes
2answers
991 views

Grepping for CIDR ranges

From time to time I want to grep CIDR ranges out of my Apache log files. This is easy for ranges that fall on the natural boundaries (/8, /16 and /24) but not so easy for other ranges such as /17 and ...
0
votes
1answer
258 views

puppet master --compile logs errors to stdout

I see a bug about this that was accepted and then closed a year ago: http://projects.puppetlabs.com/issues/3670 but I'm using puppet 2.7.14 and am getting the same issue. I'm trying to use "puppet ...
4
votes
1answer
714 views

Ack search for literal strings [closed]

I am sick of having to escape things when I want to search for part of an html tag. How can I ack search for exactly what I type without having to escape stuff? e.g. ack-grep 'console.log(foo' I ...
3
votes
2answers
513 views

egrep matching group not printing?

I'm trying to create a bash script that will grep lines from a file using egrep. I've created the regex that should group the information I want, the issue is trying to get the output. I've been ...
2
votes
1answer
154 views

Logcheck: wildcards which include non-latin characters

On my mail server, I have a custom logcheck rule as follows, which is intended to filter messages from deliver: ^\w{3} [ :0-9]{11} [._[:alnum:]-]+ deliver\.*\): msgid=.*: saved mail to.*$ ...
1
vote
2answers
108 views

ignore lines grep

I have a very annoying message being output from a process I'm running. I'd rather not remove the line, but simply remove it with grep The messages to ignore all contain the word "requests". I could ...
0
votes
1answer
349 views

Move all images in folder to subfolder, and update all references to those images to their new location?

I have a folder which contains a ~50 text files (PHP) and hundreds of images. I would like to move all the images to a subfolder, and update the PHP files so any reference to those images point to the ...
1
vote
1answer
378 views

Need help on awk/sed/ perl pattern with regex / grep

Sample file output from grep file1:my $dbh = DBI->connect("dbi:mysql:$database_name", $DB_USER, $DB_PASSWD) file2:($dbc,$rc) = mysql_connect($mysql_host,$mysql_user,$mysql_password); The awk ...
0
votes
2answers
96 views

Recover programmation source files

I've source code files (Java and C++) to recover from a broken RAID 1+0 array, I've been able to access the virtual drive with an other server but the ReiserFS partition can't be recovered with ...
0
votes
1answer
293 views

Egrep Regular Expression to suppress certain lines

i try to use the following command to suppress certain lines of output that contain the strings "DST=192.168.1" or "DST=192.168.2" tail /var/log/messages | egrep -v -e ...
7
votes
4answers
1k views

Searching for literal “> \” using ack-grep

I am looking for lines that literally have a greater than character (a ">") followed by a space followed by a backslash character (a "\") i.e., a line with this: > \ I thought escaping would allow ...
1
vote
3answers
2k views

How do I extract the matching part of a regex on Solaris

GNU's grep has the option --only-matching, which prints just the matching region of a regular expression. I'm on a Solaris 5.10 box without any GNU tools installed, and I'm trying to achieve the same ...
0
votes
1answer
2k views

Grep date with regex

I have files with lines in the following formats: . . . 12/16/09 17:56:30.211 rest of line... . . . 12/17/09 05:34:10.809 rest of line... . . How do I grep the lines out of this file that are ...
1
vote
4answers
2k views

ls | grep regex, ignore files with .tab,

I know some regex but I don't know how to get this to work. I want to list all files that don't have .tab. and don't have ~ at the end of the filename and aren't a .o (or .bin) I can list all the ...
1
vote
3answers
2k views

Don't need the whole line, just the match from regular expression

I simply need to get the match from a regular expression: $ cat myfile.txt | SOMETHING_HERE "/(\w).+/" The output has to be only what was matched, inside the parenthesis. Don't think I can use ...