归档 2016年1月

Eclipse正则表达式查找匹配多行

使用Eclipse的正则表达式(Regular expressions)查找替换(Find/Replace)功能时,如果需要匹配多行,可以在搜索表达式中添加(?s)参数。

例如从下面的HTML文本中匹配<p class="strong"></p>的段落内容

可以采用正则表达式:(?s)<p class="strong">.*?</p>

<!doctype html>
<html>
<head>
    <title>Example Domain</title>
    <meta charset="utf-8" />
    <style type="text/css ...

继续阅读

每日归档

上个月

下个月

归档