如何找到<标签后面没有? $htmlStr = " ba <div>b <? </div>n";
$regex1 = '#<#'; // finds 3 '<'
$regex2 = '#<(?!?)#'; // does not find anyhting, although should find two '<' not followed by '?'
当我运行下面的代码: 进口重新 s = 'baaaad'
l = re.findall(r'((a)(?=a))', s)
print l
for elem in l:
print ''.join(elem)
我得到的输出: [( 'A', 'A'),( 'A', 'A' ),('a','a')] aa aa aa 这是预期的。但是,当我尝试了回顾后,即相应的策略: s =