C# Regex for Guid

后端 未结 6 1251
情歌与酒
情歌与酒 2020-11-27 03:08

I need to parse through a string and add single quotes around each Guid value. I was thinking I could use a Regex to do this but I\'m not exactly a Regex guru.

Is

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 03:26

    Most basic regex is following:

    (^([0-9A-Fa-f]{8}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{12})$) 
    

    or you could paste it here.

    Hope this saves you some time.

提交回复
热议问题