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.
glad to help you
if you really want to say thanks just click on yes
And this is the case when you do not need (but in general yes, you have to use quotes).
grep knows 3 different kind of regex, sed knows at least 2, awk has its own style, but more or less similar....
perl has its own PCRE and python knows that too.
Just clicked on yes
Quote:
Originally Posted by Turbocapitalist
syg00 mentioned them above in #2 and #4. They are perl regular expressions, ported to other languages this is often called perl-compatible regular expression (PCRE). Within perl they are properly called metasymbols and they stand in for some functionality as well as pattern data. You'll find PCRE nearly everywhere these days.
But as to whether sed and awk can understand perl's regular expression metasymbols, the answer is, "no" at least for existing versions to-date.
If you find them useful, then you can get a lot out of one-liners in perl. See the options -e, -i, -n, and -p in
Code:
man perlrun
Anything you can do with sed and awk you can do, plus more, in perl.
Regex is complex. I read online on it's usage and some stuff is still Greek to me. To learn another language like perl is going to give me a brain meltdown. Maybe I give it a quick look some day
You don't have to learn it all at once, just like you don't have to learn the languages sed and awk all at once either. Here you can use it like beginning-level sed:
Those formulas will allow you to do basic sed-like substitution but with full perl regular expressions including your full range of metasymbols and special variables.
You don't have to learn it all at once, just like you don't have to learn the languages sed and awk all at once either. Here you can use it like beginning-level sed:
Those formulas will allow you to do basic sed-like substitution but with full perl regular expressions including your full range of metasymbols and special variables.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.