【问题标题】:regular expression to search in xml file在 xml 文件中搜索的正则表达式
【发布时间】:2018-11-17 01:01:16
【问题描述】:

我有一个 xml 文件,里面有很多链接和一些其他信息 我想从该 xml 中提取这些链接以将它们放入另一个文本文件中。 我正在使用 sublime 3,所以我想要一个正则表达式来搜索 xml 文件中的链接 这是一些文件

<Row ss:Height="13.8"><Cell ss:Formula="of:=HYPERLINK(&quot;http://csr.bu.edu/ftp/asl/asllvd/demos/verify_start_end_handshape_annotations//test_auto_move//signs_mov_separ_signers/Liz_10.mov&quot;; &quot;MOV&quot;)"><Data ss:Type="String">MOV</Data></Cell></Row>
<Row ss:Height="13.8"><Cell ss:Formula="of:=HYPERLINK(&quot;http://csr.bu.edu/ftp/asl/asllvd/demos/verify_start_end_handshape_annotations//test_auto_move//signs_mov_separ_signers/Tyler_10.mov&quot;; &quot;MOV&quot;)"><Data ss:Type="String">MOV</Data></Cell></Row>
<Row ss:Height="13.8"><Cell ss:Formula="of:=HYPERLINK(&quot;http://csr.bu.edu/ftp/asl/asllvd/demos/verify_start_end_handshape_annotations//test_auto_move//signs_mov_separ_signers/Naomi_10.mov&quot;; &quot;MOV&quot;)"><Data ss:Type="String">MOV</Data></Cell></Row>
<Row ss:Index="7" ss:Height="13.8"><Cell ss:Formula="of:=HYPERLINK(&quot;http://csr.bu.edu/ftp/asl/asllvd/demos/verify_start_end_handshape_annotations//test_auto_move//signs_mov_separ_signers/Brady_10.mov&quot;; &quot;MOV&quot;)"><Data ss:Type="String">MOV</Data></Cell></Row>

我想把这些链接提取成这样

http://csr.bu.edu/ftp/asl/asllvd/demos/verify_start_end_handshape_annotations//test_auto_move//signs_mov_separ_signers/Liz_10.mov

我该怎么做?

【问题讨论】:

标签: regex xml sublimetext3


【解决方案1】:

不是最好的解决方案,但它有效

(http(s)??).+?(?=&quot)

【讨论】:

  • 只是另一个问题,如果我想从该 xml 行中获取 WEAVE 这个词该怎么做? &lt;Row ss:Height="12.81"&gt;&lt;Cell&gt;&lt;Data ss:Type="String"&gt;WEAVE&lt;/Data&gt;&lt;/Cell&gt;&lt;/Row&gt;
  • @MustafaMancy (?&lt;=[&gt;])[A-Z]+?(?=[&lt;])
猜你喜欢
  • 1970-01-01
  • 2023-01-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多