Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to locate any template files in our file hierarchy that contain specific patterns... I'm familiar with regex... have been using it for a few years now with the assistance of regexr...
I am using Ubuntu 11.04
Now when I try using the syntax found on the man pages and many other how-to sites I never get any results, yet I know there are files with these patterns in them...
What the deal, yo?
Examples of patterns I'm using that simply do not return any results:
In basic regular expressions the meta-characters ?, +, {, |, (, and ) lose their special meaning; instead use the backslashed versions \?, \+, \{, \|, \(, and \).
Also, use single quotes unless you need variable expansion:
the exact opposite of what the man page says below?
Quote:
In basic regular expressions the meta-characters ?, +, {, |, (, and ) lose their special meaning; instead use the backslashed versions \?, \+, \{, \|, \(, and \).
I did read the man page before posting here btw... it doesn't seem to make any sense.
When I try with the backslash in front of the parenthesis this is the return:
Quote:
$ grep -r 'radius\(' *
grep: Unmatched ( or \(
I am at the root where many files have multiple lines of CSS3 border-radius styles containing the exact spelling and capitalization as: "-radius(" -In fact I can look them up and open them in the folder tree using vi or nano... however this returns 0 results:
the exact opposite of what the man page says below?
I did read the man page before posting here btw... it doesn't seem to make any sense.
The man page is very terse, but what it's saying is that in the default basic mode, a '(' will match a literal '(' in the text. You use '\(' for grouping, eg: 'Linux\(Questions\|Answers\)' matches 'LinuxQuestions' and also matches 'LinuxAnswers', 'Linux(Questions|Answers)' matches just the literal string 'Linux(Questions|Answers)'. If you use grep -E for extended mode, the sense of '\(' and '(' is reversed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.