On Monday 27,February,2012 12:16 AM, Allan Wind wrote:
On 2012-02-26 23:30:55, lina wrote:
$ echo "GNU linux is cool" | sed -e 's/\(<[^ ]*>\)\([ ]*\)\(<[^ ]*>\)/\3\2\1/g'
GNU linux is cool

What is it that you are trying to do?  The regex is looking for

It's an example from a book. I just clumsily wish to get some improvement by understanding some examples.


<optional non-space>optional space<optional non-space>

and as there are no<>  in the input nothing matches.  The -n
argument to sed quite useful to see this in which case you use
the p command to print what matches.

Thanks,

Best regards,


/Allan


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f4a6234.8030...@gmail.com

Reply via email to