Sponsored Content
Full Discussion: grep or sed patterns
Top Forums Shell Programming and Scripting grep or sed patterns Post 302257733 by oxoxo on Thursday 13th of November 2008 01:14:13 AM
Old 11-13-2008
Java grep or sed patterns

i want to match a pattern

Code:
* ^Subject:.*<\hello\>

for my emails to me that has 'hello' anywhere in the subject.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep for multiple patterns

I want to get a list of all the files in the current directory that have two patterns. I can do first grep of one pattern and then with the output do the grep of the second pattern. if the output of 1st pattern search results in many files, it is very difficult to do a grep of the 2nd pattern for... (1 Reply)
Discussion started by: tselvanin
1 Replies

2. Shell Programming and Scripting

Grep multiple patterns

Hi, Can we grep multiple patterns in UNIX. for example: cat /x/y/oratab | grep -i "pattern1|pattern2" .... etc I require the syntax for multiple patterns. | is not working as I explained in example. Malay (4 Replies)
Discussion started by: malaymaru
4 Replies

3. Shell Programming and Scripting

Grep for Multiple patterns

Hi All, I have a file. I need to find multiple patterns in a row and need those rows to divert to new file. I tried using grep -e / -E / -F options as given in man. But its not working. ==> cat testgrep.txt william,fernandes,xxxxx mark,morsov,yyyy yy=,xx= yyyy=,xxxx== ==>... (7 Replies)
Discussion started by: WillImm123
7 Replies

4. Shell Programming and Scripting

grep patterns - File

Hi I have 3 patterns for example to be searched. These three patterns are available in file1. The patterns to be searched are in file2. I want to search the pattern of file1 to file2. Can any one help with example? Regards Dhana (1 Reply)
Discussion started by: dhanamurthy
1 Replies

5. Shell Programming and Scripting

Grep All lines between 2 different patterns

I need a simple script to get all lines between 2 Patterns, e.g. ............. ............. 114456723: testing Script Alpha Beta 114459234: testing Done ............. ............. It should give all the lines in between 114456723 and 114459234, including these as well. Any... (2 Replies)
Discussion started by: gurpreet470
2 Replies

6. Shell Programming and Scripting

grep for multiple patterns

I have a file with many rows. I want to grep for multiple patterns from the file. For eg: XX=123|YY=222|ZZ=566 AA=123|EE=222|GG=566 FF=123|RR=222|GG=566 DD=123|RR=222|GG=566 I want the lines which has both XX and ZZ. I know I can get it like this. grep XX file | grep YY But... (10 Replies)
Discussion started by: tene
10 Replies

7. Shell Programming and Scripting

grep value between two patterns

Hi All, I've been trying solve this with a simple command but not having much luck. I have a file like this: Line 1: random_description 123/alert/high random_description2 356/alert/slow Line 2: random_description3 654/alert/medium Line 3: random_description4 234/alert/critical I'm... (7 Replies)
Discussion started by: joe19
7 Replies

8. UNIX for Dummies Questions & Answers

Grep - various patterns

I have a file with the following text: grep \$ grep \\$ grep \\\$ grep '\$' grep '\'$' grep \\ grep \\\\ grep "\$" grep '"$' grep "$" When I perform these same commands on this file, the result are never what I would expect them to be. Could someone please comment on the results and... (3 Replies)
Discussion started by: uran101
3 Replies

9. Shell Programming and Scripting

Grep patterns

Hi Experts, I have a log file like this.I need to filter the Index name and elapsed time(only created ). 06:36:39 SQL> create index XYZ_F75 on XYZ 06:36:39 2 ("GRP_ID", "_ID") parallel 64 nologging 06:36:39 3 tablespace XARGS_IDX 06:36:39 4 ; Index created. Elapsed:... (2 Replies)
Discussion started by: navsan420
2 Replies

10. Shell Programming and Scripting

How to use grep with multiple patterns?

I am trying to grep a variable with multiple lines with multiple patterns below is the pattern list in a variable called "grouplst", each pattern is speerated by "|" grouplst="example1|example2|example3|example4|example5|example6|example7" I need to use the patterns above to grep a... (2 Replies)
Discussion started by: ajetangay
2 Replies
PCRE_DFA_EXEC(3)					     Library Functions Manual						  PCRE_DFA_EXEC(3)

NAME
PCRE - Perl-compatible regular expressions SYNOPSIS
#include <pcre.h> int pcre_dfa_exec(const pcre *code, const pcre_extra *extra, const char *subject, int length, int startoffset, int options, int *ovector, int ovecsize, int *workspace, int wscount); DESCRIPTION
This function matches a compiled regular expression against a given subject string, using an alternative matching algorithm that scans the subject string just once (not Perl-compatible). Note that the main, Perl-compatible, matching function is pcre_exec(). The arguments for this function are: code Points to the compiled pattern extra Points to an associated pcre_extra structure, or is NULL subject Points to the subject string length Length of the subject string, in bytes startoffset Offset in bytes in the subject at which to start matching options Option bits ovector Points to a vector of ints for result offsets ovecsize Number of elements in the vector workspace Points to a vector of ints used as working space wscount Number of elements in the vector The options are: PCRE_ANCHORED Match only at the first position PCRE_BSR_ANYCRLF R matches only CR, LF, or CRLF PCRE_BSR_UNICODE R matches all Unicode line endings PCRE_NEWLINE_ANY Recognize any Unicode newline sequence PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline sequences PCRE_NEWLINE_CR Set CR as the newline sequence PCRE_NEWLINE_CRLF Set CRLF as the newline sequence PCRE_NEWLINE_LF Set LF as the newline sequence PCRE_NOTBOL Subject is not the beginning of a line PCRE_NOTEOL Subject is not the end of a line PCRE_NOTEMPTY An empty string is not a valid match PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8 validity (only relevant if PCRE_UTF8 was set at compile time) PCRE_PARTIAL Return PCRE_ERROR_PARTIAL for a partial match PCRE_DFA_SHORTEST Return only the shortest match PCRE_DFA_RESTART This is a restart after a partial match There are restrictions on what may appear in a pattern when using this matching function. Details are given in the pcrematching documenta- tion. A pcre_extra structure contains the following fields: flags Bits indicating which fields are set study_data Opaque data from pcre_study() match_limit Limit on internal resource use match_limit_recursion Limit on internal recursion depth callout_data Opaque data passed back to callouts tables Points to character tables or is NULL The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, and PCRE_EXTRA_TABLES. For this matching function, the match_limit and match_limit_recursion fields are not used, and must not be set. There is a complete description of the PCRE native API in the pcreapi page and a description of the POSIX API in the pcreposix page. PCRE_DFA_EXEC(3)
All times are GMT -4. The time now is 11:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy