Hey ya all,

I am trying to convert to following asp.net code to php version.

My php code which always says there is a phase error on line 2 "Parse error: parse error in c:\program files\easyphp1-8\www\index.php on line 2" even if I remove line 2 and 16, 17 & 18

Code:
<?php
try {
	$GetTheRegularExpressionString = $_POST['TheRegularExpression'];
	$GetTheStringToValidateString = $_POST['TheString'];
	if ((isset($GetTheRegularExpressionString) == true) && (isset($GetTheStringToValidateString) == true)) {
		if (preg_match($GetTheRegularExpressionString, $GetTheStringToValidateString) == true) {
			print "dat=true";
		} else {
			print "dat=false";
		}
	} else {
		print "dat=opps";
		$URL="RegularExpressionsHTMLVersion.aspx";
		header ("Location: $URL");
	}
} catch (Exception $exception) {
	print ("dat=" + $exception->getMessage()."\n".$error->getDebugInfo()); 
}
?>
My asp.net code:

Code:
<%@ Import NameSpace="System" %>
<%@ Import NameSpace="System.Net" %>
<%@ Import NameSpace="System.IO" %>
<%@ Import NameSpace="System.Text.RegularExpressions" %>
<%@ Page Language="VB" Debug="true" validateRequest="false" AutoEventWireup="true" %>
<script runat="server"> 
    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        ' check page isn't been post back from form event procedures
        Try
            Dim GetTheRegularExpressionString As String = New String(Request.Form("TheRegularExpression"))
            Dim GetTheStringToValidateString As String = New String(Request.Form("TheString"))
            If GetTheRegularExpressionString.Length <> 0 And GetTheStringToValidateString.Length <> 0 Then
                Dim StringRegex As System.Text.RegularExpressions.Regex = New System.Text.RegularExpressions.Regex(GetTheRegularExpressionString)
                If StringRegex.Match(GetTheStringToValidateString).Success = True Then
                    Response.Write("dat=True")
                Else
                    Response.Write("dat=False")
                End If
            Else
                Response.Write("dat=False")
                Response.Redirect("RegularExpressionsHTMLVersion.aspx")
            End If
        Catch ex As Exception
            Response.Write("dat=" & ex.ToString)
        End Try
    End Sub
</script>
Can any one tell me what I’m missing as far as i can see it all seams ok !?