On Thursday 11 August 2005 12:03, ANDONE Mures wrote: > On 8/10/05, Mihai Maties <[EMAIL PROTECTED]> wrote: > > On Wednesday 10 August 2005 08:41, ANDONE Mures wrote: > > > unde gresesc? de ce nu merg back-reference in sed? > > > vreau ca din momo123 sa transform in 123toto > > > > > > mures [~]..>>echo momo123| sed 's/momo(.*)/\1toto/g' > > > sed: -e expression #1, char 19: Invalid reference \1 on `s' command's > > > RHS > > > > Nu ai escapat corect parantezele folosite pentru a grupa expresia > > regulata. Daca vrei sa folosesti expresia de mai sus, atunci adauga "-r" > > la argumentele lui sed sau rescrie expresia dupa cum ti-a indicat > > Cristian Bica. > > > > > > Mihai > > A mers. Multumesc. > > PS: de curiozitate, nu inteleg de ce trebuie sa escapez parantezele, > si doar am pus toata 'comanda' de la sed intre apostroafe... de ce nu > trebuie escapate si '.' si '*' ?
citez din "info sed": <--- cut here ---> Appendix A Extended regular expressions *************************************** The only difference between basic and extended regular expressions is in the behavior of a few characters: `?', `+', parentheses, and braces (`{}'). While basic regular expressions require these to be escaped if you want them to behave as special characters, when using extended regular expressions you must escape them if you want them _to match a literal character_. </--- cut here ---> Mihai -- This message was scanned for spam and viruses by BitDefender. For more information please visit http://www.bitdefender.com/