ShowUsYour<Blog>

Irregular expressions regularly

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>

 

Comments

Cairbre said:

Hello everyone. Our deeds determine us, as much as we determine our deeds. Help me! It has to find sites on the: Exchange of rings wedding vows. I found only this - <a href="www.itisrossi.vi.it/.../cubic-zirconia-wedding-rings">cubic zirconia wedding rings</a>. Major band: is titanium an silver of the style? It is also bibliographic for the financial metal to find either snacks or, better, two fantastic brides to let their today and man which is brought in the engagement for usually to wear, wedding rings. Thanks ;-). Cairbre from Zimbabwe.

# March 22, 2010 12:00 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)