Regex to get port number

I have .config file I wanna dynamically get the regex value. Regex to get the port value in the example above. this config file is the config file of the robot stream.

<?xml version="1.0" encoding="utf-8" ?>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
    <add key="port" value="8080" />

I wanted to get the value 8080


Can you try the following?


Note: It might be better to use deserialize XML than regex.


1 Like