Regex 正则表达式记事本++;代替

Regex 正则表达式记事本++;代替,regex,replace,notepad++,Regex,Replace,Notepad++,我试图仅替换此代码块中的“删除”字符串: <table asldkjf> remove remove remove <tr> 去除 去除 去除 问题在于将“asldkjf”字符串保留在表标记中 我试着换了 <table[^>]*>[^<]*<tr> <table[^>]*>[^<]*<tr> ]*>[^ 我得到了 <table[^>]*><tr> <t

我试图仅替换此代码块中的“删除”字符串:

<table asldkjf>
remove
remove
remove
<tr>

去除
去除
去除
问题在于将“asldkjf”字符串保留在表标记中

我试着换了

<table[^>]*>[^<]*<tr>
<table[^>]*>[^<]*<tr>
]*>[^
我得到了

<table[^>]*><tr>
<table><tr>
]*>
这是不正确的,因为它将“asldkjf”替换为“[^>]*”

我已经试着根据


]*>[^使用捕获组并围绕要在替换中使用其文本的图案。您可以使用
$n
引用它们,其中n是捕获组的编号

有关捕获组工作方式的详细信息

查找内容:

(<table[^>]*>)[^<]*(<tr>)
你可以用这个reegx

(?<=<table asldkjf>).*(?=<tr>)
(?
(<table[^>]*>)[^<]*(<tr>)
$1$2
(?<=<table asldkjf>).*(?=<tr>)