LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   differences between shell regex and php regex and perl regex and javascript and mysql (http://www.linuxquestions.org/questions/linux-general-1/differences-between-shell-regex-and-php-regex-and-perl-regex-and-javascript-and-mysql-875497/)

golden_boy615 04-17-2011 03:57 PM

differences between shell regex and php regex and perl regex and javascript and mysql
 
hello
I want to know what is the difference between regex in linux shell and php and perl and javascript and mysql. Are they the same or not ?I mean by learning one can I use them in other one or there is some small or big differences between them? are they using different parameter and commands ?

Thanks

Telengard 04-17-2011 04:39 PM

In my experience you have to carefully read the documentation for each to understand the differences. Honestly it is a total PITA having so many different syntaxes, and I can never keep them straight in my head.

Most GNU programs like grep, find, locate, and others support multiple types of regular expressions which can be specified on invocation. Even more confusingly one must remember different methods of escaping various meta-characters in various environments.

HTH

chrism01 04-19-2011 02:10 AM

They are different; see http://regex.info/ for the best book :) imho. Very well written & currently in it's 3rd edition.
Other than that, consult the docs for each language.


All times are GMT -5. The time now is 06:57 PM.