On Sun, Mar 02, 2003 at 07:50:11PM -0800, agenthh wrote:
> Works fine. But, no white space in front and no extra junk in back is
> also good.
> $name =~ s/\s*\[No C-D\].*\n//g; does the trick.
> e.g. "This is a dumb name     [No C-D] blah!" would be shortened to
> "This is a dumb name".

The [No C-D] tag is prepended to the existing name, with no whitespace
added. The substitution below is correct, assuming "[No C-D]" isn't part
of someone's name; strip off the "g" at the end to be safe :)


> You would place this in the hlstats or psychostats or whatevers script
> where it processes the log entries.
>
> Also, if it you got a program that isn't written in Perl, execute this
> as a shell command: "perl -e '$_ = <>; s/\s*\[No C-D\].*\n//g; print;'".
> It does the same as the aforementioned code.
>
> --agenthh
>
> SQLBoy wrote:
> > Almost, but I think its:
> >
> > $name =~s/\[No C-D\]//g;
> >
> > I think..I suck at regex.
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlds_linux

--
Blaine Kahle
[EMAIL PROTECTED]
0x178AA0E0
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux

Reply via email to