[Za-pm] regex ctrl char?

Jonathan McKeown jonathan at hst.org.za
Mon Jun 26 01:09:14 PDT 2006


On Monday 26 June 2006 09:46, Spike wrote:
> Hi All
> I came across the code below while looking at a script written by
> someone who no longer works with us.
>
> Does anyone have any idea what the /\c@/ is meant to match?
>
> \c usually indicate a control character but I don't know what the @ is for.
>
>
> if($a_username=~/\c@/ || $a_authresult=~/\c@/ || $a_password_entry=~/\c@/)

It's checking for NUL (ASCII 0), which can also be written "\0".
Try

print ord("\c@");

Jonathan


More information about the Za-pm mailing list