English 中文(简体)
ASP 传统: 仅由有效char子组成的检查
原标题:ASP Classic: Check if string only consists of valid chars

我一直在互联网上检查所有情况,但确实能够找到解决我问题的任何具体办法。

我如何检查扼杀是否只包含已宣布的有效特性?

我只想听从0-9、A-Z和a-z。

So the string oifrmf9RWGEWRG3oi4m3ofm3mklwef-qæw should be invalid because of - and æ while the string joidsamfoiWRGWRGmoi34m3f should be valid.

我一直在利用“建筑工程”来修补地毯,以修补地毯,但是,这还是有可能使它检查并归还一种假肢或真象吗?

我:

set pw = new regexp
pw.global = true
pw.pattern = "[^a-zA-Z0-9]"

newstring = pw.replace("iownfiwefnoi3w4mtl3.-34ø 3", "")

感谢:

最佳回答

http://msdn.microsoft.com/en-us/library/y32x2hy1%28v=vs.85%29.aspx”rel=“noreferer” 1. 真实或隐蔽

If( pw.Test("string") ) Then
   Do something
End If
问题回答

Try -

Dim myRegExp, FoundMatch
Set myRegExp = New RegExp
myRegExp.Pattern = "[^a-zA-Z0-9]"
FoundMatch = myRegExp.Test("iownfiwefnoi3w4mtl3.-34ø 3")

如果<代码>FoundMatch 是真的,那么,RegEx发动机发现的特性不是z 或A-Z 或0-9 ,且你的舱位无效。

你可以做这样的事情:

Set match = pw.execute("iownfiwefnoi3w4mtl3.-34ø 3")

if match.count > 0 then
     your pattern matched, so it s invalid
   badString = true
else
   badString = false
end if

不要取代你,就能够看看看看看看看看看看看看是否在白人名单上外有任何特性。 The general for eachyntax is





相关问题
Uncommon regular expressions [closed]

Recently I discovered two amazing regular expression features: ?: and ?!. I was curious of other neat regex features. So maybe you would like to share some tricky regular expressions.

regex to trap img tag, both versions

I need to remove image tags from text, so both versions of the tag: <img src="" ... ></img> <img src="" ... />

C++, Boost regex, replace value function of matched value?

Specifically, I have an array of strings called val, and want to replace all instances of "%{n}%" in the input with val[n]. More generally, I want the replace value to be a function of the match ...

PowerShell -match operator and multiple groups

I have the following log entry that I am processing in PowerShell I m trying to extract all the activity names and durations using the -match operator but I am only getting one match group back. I m ...

Is it possible to negate a regular expression search?

I m building a lexical analysis engine in c#. For the most part it is done and works quite well. One of the features of my lexer is that it allows any user to input their own regular expressions. This ...

regex for four-digit numbers (or "default")

I need a regex for four-digit numbers separated by comma ("default" can also be a value). Examples: 6755 3452,8767,9865,8766,3454 7678,9876 1234,9867,6876,9865 default Note: "default" ...

热门标签