Home All Groups Group Topic Archive Search About
Author
22 Mar 2007 3:22 AM
Jeff
hey gang.

I am having a problem with something. I run an online tournament site.
With hosting for clans, more so then not, the clan tags contain charactures
like + { [ in front of the tag letters.
what I am having a problem with is if it starts with a +, it isn't picking
up the name correctly. If in a sql statement, it looks for a tag that starts
with a +, it won't find it. And sometimes, when it is supposed to move the
tag over in a bracket, it moves it without the +.

for example, +EcK+ is the tag, it will either not find it, or move it over
as EcK without the +'s.

is there any way around this?
i know for some strings, such as things with ' you can use

replace (request.form("var"), "'", "''")

but not sure about these other charactures.
any help out there??
it would be most appreciated

Author
22 Mar 2007 10:52 AM
Evertjan.
Jeff wrote on 22 mrt 2007 in microsoft.public.inetserver.asp.general:

Show quoteHide quote
> hey gang.
>
> I am having a problem with something. I run an online tournament site.
> With hosting for clans, more so then not, the clan tags contain
> charactures like + { [ in front of the tag letters.
> what I am having a problem with is if it starts with a +, it isn't
> picking up the name correctly. If in a sql statement, it looks for a
> tag that starts with a +, it won't find it. And sometimes, when it is
> supposed to move the tag over in a bracket, it moves it without the +.
>
> for example, +EcK+ is the tag, it will either not find it, or move it
> over as EcK without the +'s.
>
> is there any way around this?
> i know for some strings, such as things with ' you can use
>
> replace (request.form("var"), "'", "''")
>
> but not sure about these other charactures.
> any help out there??
> it would be most appreciated

Try regex. It has a seep learning curve but the results are fine.

<http://msdn2.microsoft.com/en-us/library/6wzad2b2.aspx>


======== vbs ==============

  str1 = "+EcK+"
  Set regEx = New RegExp
  regEx.Pattern = "^[+{\(]"
  ' regEx.IgnoreCase = True
  regEx.Global = True
  str1 = regEx.Replace(str1, replStr)

==========================


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Are all your drivers up to date? click for free checkup

Author
22 Mar 2007 6:24 PM
Jeff
Show quote Hide quote
"Evertjan." <exjxw.hannivo***@interxnl.net> wrote in message
news:Xns98FB78E19454Beejj99@194.109.133.242...
> Jeff wrote on 22 mrt 2007 in microsoft.public.inetserver.asp.general:
>
>> hey gang.
>>
>> I am having a problem with something. I run an online tournament site.
>> With hosting for clans, more so then not, the clan tags contain
>> charactures like + { [ in front of the tag letters.
>> what I am having a problem with is if it starts with a +, it isn't
>> picking up the name correctly. If in a sql statement, it looks for a
>> tag that starts with a +, it won't find it. And sometimes, when it is
>> supposed to move the tag over in a bracket, it moves it without the +.
>>
>> for example, +EcK+ is the tag, it will either not find it, or move it
>> over as EcK without the +'s.
>>
>> is there any way around this?
>> i know for some strings, such as things with ' you can use
>>
>> replace (request.form("var"), "'", "''")
>>
>> but not sure about these other charactures.
>> any help out there??
>> it would be most appreciated
>
> Try regex. It has a seep learning curve but the results are fine.
>
> <http://msdn2.microsoft.com/en-us/library/6wzad2b2.aspx>
>
>
> ======== vbs ==============
>
>  str1 = "+EcK+"
>  Set regEx = New RegExp
>  regEx.Pattern = "^[+{\(]"
>  ' regEx.IgnoreCase = True
>  regEx.Global = True
>  str1 = regEx.Replace(str1, replStr)
>
> ==========================


i believe i have the basic understanding of this.
however, when i run the code, and do a response.write str1

i get EcK+
isn't it supposed to replace both +'s?

<%
str1 = "+EcK+"
  Set regEx = New RegExp
  regEx.Pattern = "^[+{\(]"
  ' regEx.IgnoreCase = True
  regEx.Global = True
  str1 = regEx.Replace(str1, replStr)
  response.write str1

  %>

http://tournamentsbyeck.com/test.asp
Author
22 Mar 2007 7:27 PM
Evertjan.
Jeff wrote on 22 mrt 2007 in microsoft.public.inetserver.asp.general:

Show quoteHide quote
>> ======== vbs ==============
>>
>>  str1 = "+EcK+"
>>  Set regEx = New RegExp
>>  regEx.Pattern = "^[+{\(]"
>>  ' regEx.IgnoreCase = True
>>  regEx.Global = True
>>  str1 = regEx.Replace(str1, replStr)
>>
>> ==========================
>
>
> i believe i have the basic understanding of this.
> however, when i run the code, and do a response.write str1
>
> i get EcK+
> isn't it supposed to replace both +'s?

No , I thought you wanted only a leading char removed.

>
> <%
> str1 = "+EcK+"
>   Set regEx = New RegExp
>   regEx.Pattern = "^[+{\(]"

If you want all occurances of those three removes do this:

regEx.Pattern = "[+{\(]+"


>   ' regEx.IgnoreCase = True
>   ' regEx.Global = True

regEx.Global = True

Show quoteHide quote
>   str1 = regEx.Replace(str1, replStr)
>   response.write str1
>
>   %>



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
22 Mar 2007 11:10 PM
Jeff
Show quote Hide quote
>
> I am having a problem with something. I run an online tournament site.
> With hosting for clans, more so then not, the clan tags contain
> charactures like + { [ in front of the tag letters.
> what I am having a problem with is if it starts with a +, it isn't picking
> up the name correctly. If in a sql statement, it looks for a tag that
> starts with a +, it won't find it. And sometimes, when it is supposed to
> move the tag over in a bracket, it moves it without the +.
>
> for example, +EcK+ is the tag, it will either not find it, or move it over
> as EcK without the +'s.
>
> is there any way around this?
> i know for some strings, such as things with ' you can use
>
> replace (request.form("var"), "'", "''")
>
> but not sure about these other charactures.
> any help out there??
> it would be most appreciated
>

Just wanted everyone to know, that using Server.URLEncode has solved this
problem. the problem was in the querystring

thanks again

Bookmark and Share

Post Thread options