Home | Support Forums | Demo | Purchase | Contact Us | MPopper | MChecker | News | Knowledgebase
Welcome Guest Search | Active Topics | Members | Log In | Register

Regular expression Options · View
gdavey
Posted: Thursday, July 26, 2007 12:42:34 PM
Rank: Newbie
Groups: Member

Joined: 7/26/2007
Posts: 3
Points: 9
Location: South Africa

Hi. I have extreme difficulties adding a regular expression.
Reference to my_message.aspx +- line 815 <bdy1 = REPLACE(replace(replace(replace(r.....>


it is in bdy where I want to do a regular Expression replace.
Normall in Classic ASP, I would have don it like this:


'--------------------------------------
Dim myre, strInput
Set myre = New RegExp
strpattern = "\b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b"
myre.Pattern="(" & strpattern & ")"
myre.IgnoreCase=True
myre.Global=True
bdy1 = myre.Replace(strInput,"mailAddressRemoved")
set re = nothing
'--------------------------------------------


but now this is .net, so I would assume that RegEx will work
something like this:
'--------------------------------
Public Dim regex As Regex = New Regex( _
      "([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\."+ _
      ")|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})", _
    RegexOptions.IgnoreCase _
    Or RegexOptions.CultureInvariant _
    Or RegexOptions.IgnorePatternWhitespace _
    Or RegexOptions.Compiled _
    )
Public Dim regexReplace As String = _
      "EmailAddressRemoved"
 Dim result As String = regex.Replace(InputText,regexReplace)
bdy1 = result
'-------------------------------

This all does create errors... no I must add that I'm not a .net programmer, but all the code that is just between asp indicators <% %> looks like regular asp to me, and the other within the script vb runat server tags look like vb for .net.

So I tried both the above between <script> tags as well as between <% tags, but neither seems to work.


I also tried the ''  Imports System.Text.RegularExpressions at the top of the aspx page, with no results.

PLEASE give me some guideline.


Thanks


 


 

admin
Posted: Thursday, July 26, 2007 5:51:54 PM

Rank: Administration
Groups: Administration

Joined: 7/1/2008
Posts: 256
Points: 574
the seems fine to me
just remove the line  Imports System.Text.RegularExpressions from the page and add it to functions/functions.aspx

and it should work !

Thanks
gdavey
Posted: Friday, July 27, 2007 3:09:03 AM
Rank: Newbie
Groups: Member

Joined: 7/26/2007
Posts: 3
Points: 9
Location: South Africa

Ive tried functions.aspx and it throws and error. See the two places I have tried. All three red items tried seperatly. Blue is comments.  Shouldn't Imports System.Text.RegularExpressions   be something that is put in the code behind .vb file ? I don't have the source code. The example below is from functions.aspx.


<%@ import namespace="System.IO.Stream" %>
<%@ import namespace="system.io" %>
<%@ import namespace="system.drawing.drawing2d" %>
<%@ import namespace="system.drawing.imaging" %>
<%@ import namespace="system.drawing" %>
<%@ import namespace="system.text.regularExpressions" %> Does not work like this, but no errors recieved, only when trying to use RegEx
<%@ Imports System.Text.RegularExpressions  %>
Does not work like this. immediate error
<%@ Page Language="vb" aspcompat=true  AutoEventWireup="false" Codebehind="functions.aspx.vb" Inherits="MailYouLikev3.functions"  %>
<%@ Imports System.Text.RegularExpressions  %> Does not work like this. Immediate error
<%
dim re = getcharset()
if re = "" then
if Session("SK_UserAuthorization")="admin" then 
.....

admin
Posted: Friday, July 27, 2007 4:13:02 AM

Rank: Administration
Groups: Administration

Joined: 7/1/2008
Posts: 256
Points: 574
Can you please email support@mailyoulike.com your ftp info so that we can make this work for you !

Thanks
gdavey
Posted: Friday, July 27, 2007 8:12:07 AM
Rank: Newbie
Groups: Member

Joined: 7/26/2007
Posts: 3
Points: 9
Location: South Africa

OK, mail sent!


Styles and skins alreay heavy modified. Please do not overwrite. (Default Style as well as changes of styles direct in pages.

admin
Posted: Saturday, July 28, 2007 11:15:18 AM

Rank: Administration
Groups: Administration

Joined: 7/1/2008
Posts: 256
Points: 574
i have uploaded the file
my_messageRegEx.aspx  with the changes  you can rename it to  my_message.aspx and check it works !

Thanks
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.098 seconds.