0

I am using SSH secure shell in Unix, I want to search file with some 'TEXT' or string
and that string is like 'PACKAGE', followed by '%PA%EVENTS%'('PA_PACKAGE %PA%EVENTS%') this % i am assuming as in SQL*PLUS, means i a string PA can occur any where before EVENTS and EVENTS can occur any where after PA, I want to search those file which this REGEX matches.

2
  • 1
    Could you give some sample of lines? Commented Oct 4, 2010 at 14:11
  • but there is a space btween PACKAGE and '%PA%EVENTS%.. Commented Oct 4, 2010 at 14:58

3 Answers 3

1

I ma not sure exactly what you are hoping to match, but the following will print out the lines that contain the text "PACKAGE" followed but zero or more characters and then the text "EVENTS", from all the files in the current directory.

grep "PACKAGE.*EVENTS" *

Please give some more examples of what you want, so I can be more specific.

Sign up to request clarification or add additional context in comments.

Comments

0
grep -l "PACKAGE*EVENTS" *

recursive:

grep -Rl "PACKAGE*EVENTS" *

1 Comment

"E*E" means two or more Es, your wan't "E.*E" meaning E + any number of any character + another E. See Beano's example.
0

try this: egrep -e "PACKAGE PA*EVENTS" file

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.