|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
replacing charactureI 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 Jeff wrote on 22 mrt 2007 in microsoft.public.inetserver.asp.general:
Show quoteHide quote > hey gang. Try regex. It has a seep learning curve but the results are fine.> > 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 <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)
Show quote
Hide quote
"Evertjan." <exjxw.hannivo***@interxnl.net> wrote in message i believe i have the basic understanding of this.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) > > ========================== 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 Jeff wrote on 22 mrt 2007 in microsoft.public.inetserver.asp.general:
Show quoteHide quote >> ======== vbs ============== No , I thought you wanted only a leading char removed.>> >> 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? > If you want all occurances of those three removes do this:> <% > str1 = "+EcK+" > Set regEx = New RegExp > regEx.Pattern = "^[+{\(]" 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)
Show quote
Hide quote
> Just wanted everyone to know, that using Server.URLEncode has solved this > 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 > problem. the problem was in the querystring thanks again
HOWTO Make CStr for JavaScript on ASP w/ Request.Form and QueryStr
PRB JavaScript in ASP with Request.Form generate xml without need to persist it in a file? why I need to click refresh button in order to see session values will I burn in hell for using all VARCHAR(MAX)? multiple image submit buttons in one form Error reading xml document in Asp How to store a class in a cookie and retrieve? SQL statement using two tables ASP input and EXCEL |
|||||||||||||||||||||||