让我们说我想替换这样的东西:
06-01 13:17:28.351 25469-25521/br.com.escolaemmovimento D/OpenGLRenderer﹕ Render dirty regions requested: true
06-01 13:17:28.362 25469-25469/br.com.escolaemmovimento D/﹕ HostConnection::get() New Host Connection established 0xabb84990, tid 25469
06-01 13:17:28.374 25469-25469/br.com.escolaemmovimento D/Atlas﹕ Validating map...
06-01 13:17:28.556 25469-25521/br.com.escolaemmovimento D/libEGL﹕ loaded /system/lib/egl/libEGL_emulation.so
06-01 13:17:28.557 25469-25521/br.com.escolaemmovimento D/libEGL﹕ loaded /system/lib/egl/libGLESv1_CM_emulation.so
06-01 13:17:28.568 25469-25521/br.com.escolaemmovimento D/libEGL﹕ loaded /system/lib/egl/libGLESv2_emulation.so
06-01 13:17:28.578 25469-25521/br.com.escolaemmovimento D/﹕ HostConnection::get() New Host Connection established 0xaf60b940, tid 25521
06-01 13:17:28.604 25469-25521/br.com.escolaemmovimento I/OpenGLRenderer﹕ Initialized EGL, version 1.4
06-01 13:17:28.635 25469-25521/br.com.escolaemmovimento D/OpenGLRenderer﹕ Enabling debug mode 0
06-01 13:17:28.650 25469-25521/br.com.escolaemmovimento W/EGL_emulation﹕ eglSurfaceAttrib not implemented
06-01 13:17:28.651 25469-25521/br.com.escolaemmovimento W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xaf639400, error=EGL_SUCCESS
06-01 13:17:54.808 25469-25469/br.com.escolaemmovimento I/System.out﹕ com.android.volley.NoConnectionError: java.net.UnknownHostException: Unable to resolve host "teste.escolaemmovimento.com.br": No address associated with hostname
用这个:
\section{Introduction}
在记事本++中。
基本上,查找并替换所有开始标记(在本例中为" \ section {"部分)和结束标记("}"),具有不同的开启和关闭标记,
像这样的东西。当然,除了标签之间的文本保持不变。这可能在记事本++中吗?
答案 0 :(得分:1)
找到:\\section\{(.+)\}
替换为:<h1>\1</h1>
此处,括号(.+)
定义一个由一个或多个字符组成的组,\1
引用该组的内容。
答案 1 :(得分:0)
搜索:
\\section\{(.*)\}
并替换为:
<h1>\1</h1>
\1
将替换为您的第一个正则表达式结果。
<强>即。搜索:
\{(.*), (.*)\}
替换为:
[\1, \2]
将{foo, bar}
转换为[foo, bar]
:
\1
= foo
\2
= bar
答案 2 :(得分:0)
是的,只需在查找中创建一个正则表达式组,然后在替换中引用它:
找到:
\\section\{(.*?)\}
替换为:
<h1>$1</h1>
$1
引用(.*?)
中捕获的内容。