例如,我想解析python文件与三重双引号之间的文本,并从该文本生成html表。例如像正则表达式双引号和换行符之间的提取
"""
Replaces greater than operator ('>') with 'NOT BETWEEN 0 AND #'
Replaces equals operator ('=') with 'BETWEEN # AND #'
Tested against:
* Microsoft SQL Server 2005
* MySQL 4, 5.0 and 5.5
* Oracle 10g
* PostgreSQL 8.3, 8.4, 9.0
Requirement:
* Microsoft Access
Notes:
* Useful to bypass weak and bespoke web application firewalls that
filter the greater than character
* The BETWEEN clause is SQL standard. Hence, this tamper script
should work against all (?) databases
>>> tamper('1 AND A > B--')
'1 AND A NOT BETWEEN 0 AND B--'
>>> tamper('1 AND A = B--')
'1 AND A BETWEEN B AND B--'
"""
HTML表格必须是简单的表包含5列
- 柱一切
"""
和\n if new line is empty
之间 - 柱一切
Tested against:
和\n if new line is empty
或Requirement:
之间和文本块
\n if new line is empty
- 柱一切
Notes:
和\n if new line is empty
- 柱之间的所有
>>>
和\n
- 之间柱一切
4 column end
和\n
之间,结果必然是:
- 替换大于运算符( '>' )'NOT BETWEEN 0 AND#' 用'BETWEEN#AND#'替换等于运算符('=')
-
的Microsoft SQL Server 2005
- 的MySQL 4,5.0和5.5
- 的Oracle 10g
- 的PostgreSQL 8.3,8.4,9.0
或
- Microsoft Access
-
- 有用绕过弱和定制的web应用程序的防火墙 过滤除字符
- 之间子句越大SQL标准。因此,这种篡改脚本 应反对各种(?)数据库
篡改( '1个A> B--') 篡改( '1个A = B--')
“1和未介于0和B--” “1和B之间和B--”
我可以使用什么样的语法来提取? 我将使用VBScript.RegExp。
Set fso = CreateObject("Scripting.FileSystemObject")
txt = fso.OpenTextFile("C:\path\to\your.py").ReadAll
Set re = New RegExp
re.Pattern = """([^""]*)"""
re.Global = True
For Each m In re.Execute(txt)
WScript.Echo m.SubMatches(0)
Next
非常感谢你 –
优秀的解释。 – Lankymart