Hi Colin

You may prefer this:

    $line =~ s/[\d\s()]+$//g;

which will remove all trailing whitespace, digits and parentheses from
string $line.

Rob


"Colin Johnstone" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Gidday All,
>
> Im reading course names in from a text file and want to remove the course
number from the end of each course name. Can someone help me with the regex
to do this.
>
> e.g Mathematics 2 unit (15240)
>
> to give me Mathematics 2 unit
>
> Thanking you in anticipation.
>
>
>
> Colin Johnstone
> Website Project Officer
> Corporate Website Unit
> Public Affairs Directorate
> ph 9561 8643
>
>
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to