考虑以下字符串作为输入
(msg:"NTL - ACTIVEX Possible Microsoft WMI Administration Tools WEBSingleView.ocx ActiveX Buffer Overflow Attempt Function Call"; flow:to_client,established; file_data; content:"ActiveXObject"; nocase; distance:0; content:"WBEM.SingleViewCtrl.1"; nocase; distance:0; pcre:"/WBEM\x2ESingleViewCtrl\x2E1.+(AddContextRef|ReleaseContext)/smi"; reference:url,xcon.xfocus.net/XCon2010_ChenXie_EN.pdf; reference:url,wooyun.org/bug.php?action=view&id=1006; classtype:attempted-user; sid:2012157; rev:1; metadata:affected_product Windows_XP_Vista_7_8_10_Server_32_64_Bit, attack_target Client_Endpoint, deployment Perimeter, tag ActiveX, signature_severity Major, created_at 2011_01_06, updated_at 2016_07_01;
Run Code Online (Sandbox Code Playgroud)
我需要删除所有子字符串实例 reference:url,xcon.xfocus.net/XCon2010_ChenXie_EN.pdf;
但是此参考:标签的长度可变。需要搜索“参考:”关键字,并删除所有文本,直到到达字符“;”为止。
我使用Replace了字符串类的功能,但它仅替换了固定长度的子字符串。
所需的输出是
(msg:"NTL - ACTIVEX Possible Microsoft WMI Administration Tools WEBSingleView.ocx ActiveX Buffer Overflow Attempt Function Call"; flow:to_client,established; file_data; content:"ActiveXObject"; nocase; distance:0; content:"WBEM.SingleViewCtrl.1"; nocase; distance:0; pcre:"/WBEM\x2ESingleViewCtrl\x2E1.+(AddContextRef|ReleaseContext)/smi"; classtype:attempted-user; sid:2012157; rev:1; …Run Code Online (Sandbox Code Playgroud) 我试过这个
S -> e(Epsilon)
S -> SASBS
S -> SBSAS
一个->一个
B -> b
有人可以验证这是否正确。
问题:一组 n 个硬币放在一排。硬币具有不需要不同的正值。考虑到不能捡起两个相邻的硬币的限制,找出可以收集的最大数量。
它的递归关系是
F(n) = max{cn + F(n ? 2), F(n ? 1)} for n > 1,
F(0) = 0, F(1) = c1.
Run Code Online (Sandbox Code Playgroud)
我的问题是这种递归关系是如何发展的。请有人向我解释这一点。