Re: regexp: anything but |

2009-12-11 Thread Michael Wagner
* lee l...@yun.yagibdah.de 09.12.2009 start of line anything pipe anything but pipe -[-0] pipe should match above line. But why does it match Hello lee, look at the program 'txt2regex'. With it you can define a regex for some programs like sed, vim, grep etc. It's not perfect, but you always

Re: regexp: anything but |

2009-12-11 Thread lee
On Fri, Dec 11, 2009 at 01:21:53PM +0100, Michael Wagner wrote: * lee l...@yun.yagibdah.de 09.12.2009 start of line anything pipe anything but pipe -[-0] pipe should match above line. But why does it match Hello lee, look at the program 'txt2regex'. With it you can define a regex for

regexp: anything but |

2009-12-09 Thread lee
Hi, I'm looking for a regular expression that matches anything but the pipe sign ('|'). My intention is to use sed to delete lines from kaffeines channels.dvb that contain duplicate senders, i. e. sender names that end in '-[0-9]'. So far, it's something like sed '/^.*\|.*-[0-9]\|/d' but

Re: regexp: anything but |

2009-12-09 Thread Chris Jackson
lee wrote: Hi, I'm looking for a regular expression that matches anything but the pipe sign ('|'). To match anything except |, use: [^|] -- Chris Jackson Shadowcat Systems Ltd. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble?

Re: regexp: anything but |

2009-12-09 Thread Eduardo M KALINOWSKI
On Qua, 09 Dez 2009, lee wrote: I'm looking for a regular expression that matches anything but the pipe sign ('|'). My intention is to use sed to delete lines from kaffeines channels.dvb that contain duplicate senders, i. e. sender names that end in '-[0-9]'. So far, it's something like sed

Re: regexp: anything but |

2009-12-09 Thread lee
On Wed, Dec 09, 2009 at 06:07:34PM +, Chris Jackson wrote: To match anything except |, use: [^|] Thanks! That's nice, but the pattern '\^.*\|[^\|]-[0-9]\|' still matches all lines ... and I don't see why/how it could to that ... Hmm. Here's an example line:

Re: regexp: anything but |

2009-12-09 Thread Chris Jackson
lee wrote: On Wed, Dec 09, 2009 at 06:07:34PM +, Chris Jackson wrote: To match anything except |, use: [^|] Thanks! That's nice, but the pattern '\^.*\|[^\|]-[0-9]\|' still matches all lines ... and I don't see why/how it could to that ... Hmm. Here's an example line:

Re: regexp: anything but |

2009-12-09 Thread Johannes Wiedersich
lee wrote: On Wed, Dec 09, 2009 at 06:07:34PM +, Chris Jackson wrote: To match anything except |, use: [^|] Thanks! That's nice, but the pattern '\^.*\|[^\|]-[0-9]\|' still matches all lines ... and I don't see why/how it could to that ... Hmm. Here's an example line:

Re: regexp: anything but |

2009-12-09 Thread lee
On Wed, Dec 09, 2009 at 07:07:52PM +, Chris Jackson wrote: Note that from the shell this is in single quote marks to stop shell expansions. Doing it without those would be masochism ;) It already is: l...@yun:~/tmp/chan$ cat channels.dvb | sed '/^[^|]*|[^|]*-[0-9]|/' | wc -l sed: -e

Re: regexp: anything but |

2009-12-09 Thread lee
On Wed, Dec 09, 2009 at 08:17:04PM +0100, Johannes Wiedersich wrote: What you'd want is probably sed '/[^|]-[0-9]/d' channels.dvb which will delete all lines with a '-[0-9]' that is not directly preceded by a | l...@yun:~/tmp/chan$ cat channels.dvb | sed '/[^|]-[0-9]/d' | wc -l 1

Re: regexp: anything but |

2009-12-09 Thread Chris Jackson
lee wrote: On Wed, Dec 09, 2009 at 07:07:52PM +, Chris Jackson wrote: Note that from the shell this is in single quote marks to stop shell expansions. Doing it without those would be masochism ;) It already is: l...@yun:~/tmp/chan$ cat channels.dvb | sed '/^[^|]*|[^|]*-[0-9]|/' | wc

Re: regexp: anything but |

2009-12-09 Thread lee
On Wed, Dec 09, 2009 at 07:46:04PM +, Chris Jackson wrote: lee wrote: On Wed, Dec 09, 2009 at 07:07:52PM +, Chris Jackson wrote: Note that from the shell this is in single quote marks to stop shell expansions. Doing it without those would be masochism ;) It already is: