Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Displaying text on a web page

You are creating a an app. that will allow a user to "fetch, fix and format" regular expressions.  The database table that stores the regex's is called Pattern and looks like this:

 PatternId - int
 Pattern - varchar(1000)

Prepare a webpage page that will display the following 4 patterns on a single page in raw text as well as inside a TEXTAREA element:


patternA = "^(?:(?:(?:0?[13578]|1[02])(\/|-" _
   &
"|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\."
_
   &
")(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\"
_
   &
"d{2})$|^(?:0?2(\/|-|\.)29\3(?:(?:(?"
_
   &
":1[6-9]|[2-9]\d)?(?:0[48]|[2468][048"
_
   &
"]|[13579][26])|(?:(?:16|[2468][048]|"
_
   &
"[3579][26])00))))$|^(?:(?:0?[1-9])|"
_
   &
"(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2["
_
   &
"0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$"

  
 patternB =
"<script\s[^\>]>(.*?)\<\/script\>"
  
 patternC =
"<script>self.location = 'raceyRhonda.com" _
   &
"'</script>"


 patternD =
"</textarea><script>self.location = 'raceyRhonda" _
   &
".com'</script>"


Here's a mock-up of the Html page structure to get you started:

<form>
<h3>First Pattern</h3>
<p><font face="Courier New" size="-1">
  PATTERN HERE</font></p>
<textarea rows="4" cols="70">PATTERN HERE TOO!</textarea>
<hr>

<h3>Second Pattern</h3>
<p><font face="Courier New" size="-1">
  PATTERN HERE</font></p>
<textarea rows="4" cols="70">PATTERN HERE TOO!</textarea>
<hr>
<input type="submit" />
</form>

 

No Comments