elisp使用正则表达式和规范进行搜索。字符返回零

时间:2016-11-14 16:56:41

标签: elisp

emacs 25.1

我有字符串:

<p>more complex non Q and A HTML code here.</p><table class="waffle" cellspacing="0" cellpadding="0"><thead><tr><th

如果在emacs regexp-builder中使用下一个正则表达式:"<table .*?>"

成功找到了文字:

<table class="waffle" cellspacing="0" cellpadding="0">

行。但是当我通过函数搜索转发在elisp中使用相同的正则表达式时,找不到任何内容(返回nil)

      (setq test-start-point (search-forward "<table .*?>" nil t))

测试开始点 =无。

为什么?

1 个答案:

答案 0 :(得分:1)

search-forward搜索完全匹配。在您的情况下,您希望搜索正则表达式模式,因此您希望使用re-search-forward

相关问题