procmail
[Top] [All Lists]

Re: matching the last space hyphen chars on a line

1999-01-28 12:53:31
Geoff Mulligan asked,

| How do I write a regular expression that will match only the last " -.*" on a
| line so that in the line foo -bar -one only -one would be matched and in foo
| -bar only -bar would be matched.
| 
| What I want to do is eliminate the last string of characters that start with
| space hypen.

* ()\/ -[^-]*$

If there is a problem with including the closing newline in $MATCH, then it
takes two conditions:

* ()\/-[^-]*$
* MATCH ?? ^^\/.+

<Prev in Thread] Current Thread [Next in Thread>