positive: "1.is来判断<br>groupName = params['groupName'] ##groupName的值是'url' reqBody['dim'] = groupName print(""reqBody_dim-SummaryListHandler"", reqBody['dim']) ## ('reqBody_dim-SummaryListHandler', u'url') print(""reqBody_dim_url-SummaryListHandler"", ('url' is reqBody['dim'])) ## ('reqBody_dim_url-SummaryListHandler', False) if groupName is 'url': 打印如下,看到通过is判断是false ('reqBody_dim-SummaryListHandler', u'url') ('reqBody_dim_url-SummaryListHandler', False)<br>2.id 和in<br>看到用in可以判断两个字符串相等<br>print(""groupName:"",groupName) reqBody['dim'] = groupName print(""reqBody_dim-SummaryListHandler"", reqBody['dim']) print(""reqBody_dim_url_is-SummaryListHandler"", ('url' is groupName)) print(""reqBody_dim_url_id-SummaryListHandler"", (id('url')==id(groupName))) print(""reqBody_dim_url_in-SummaryListHandler"", ('url' in groupName)) ('groupName:', u'url') ('reqBody_dim-SummaryListHandler', u'url') ('reqBody_dim_url_is-SummaryListHandler', False) ('reqBody_dim_url_id-SummaryListHandler', False) ('reqBody_dim_url_in-SummaryLis"
negative: "'正则<br>Function RegExp(text As String, reg As String) As String<br>Dim mRegExp As Object '正则表达式对象<br>Dim mMatches As Object '匹配字符串集合对象<br>Dim mMatch As Object '匹配字符串<br>RegExp = """"<br>Set mRegExp = CreateObject(""Vbscript.Regexp"")<br>With mRegExp<br>.Global = True 'True表示匹配所有, False表示仅匹配第一个符合项<br>.IgnoreCase = True 'True表示不区分大小写, False表示区分大小写<br>.Pattern = reg '匹配字符模式 "".*[款].*[号][\d]+[、](.*)""<br>SetmMatches = .Execute(text) '执行正则查找,返回所有匹配结果的集合,若未找到,则为空<br>For Each mMatch In mMatches<br>If (Not mMatch.SubMatches(0) = """") Then<br>RegExp = Trim(mMatch.SubMatches(0))<br>End If<br>Next<br>End With<br>Set mRegExp = Nothing<br>Set mMatches = Nothing<br>End Function"