Created
June 22, 2014 09:56
-
-
Save jacyzon/321bc67b448cf7d36fc0 to your computer and use it in GitHub Desktop.
Regular expression capturing MQTT device ID
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Text; | |
| using System.Text.RegularExpressions; | |
| class RegularEx | |
| { | |
| static void Main(string[] args) | |
| { | |
| string pattern = @"(?<=^mqtt-subscription-).+(?=qos1$)"; | |
| Regex regex = new Regex(pattern); | |
| Match match = regex.Match("mqtt-subscription-TEST-BLAqos1"); | |
| Console.WriteLine(match); | |
| Console.Read(); | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment