How to extract a substring from a .NET RegEx?

后端 未结 2 1822
不知归路
不知归路 2020-12-30 18:31

I have an XML file containing one (or more) key/value pairs. For each of these pairs I want to extract the value which is a two-byte hex value.

So the XML contains t

2条回答
  •  甜味超标
    2020-12-30 19:28

    Add a grouping construct to your expression ...

    (?LibID)([a-fA-F0-9]{4})
    

    That will capture the ID. But, you need to put the correct format in your expression for the actual ID, because your regex will only capture "LibID" litterally.

提交回复
热议问题