Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Kumaran-RegText-CityStatePostalCode Parsing
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { var inpt = @"Port Washington, CA 922"; var ptrn = @"^([\w\s]+(?:,|\s))\s*(\w{2})\s(\d{3,}$)|^(\w{2})\s(\d{3,}$)"; var rgx = new Regex(ptrn); Match match = rgx.Match(inpt); if (match.Success) { string v = match.Groups[1].Value; Console.WriteLine("Between One and Three: {0}", v); } } } }
run
|
edit
|
history
|
help
0
C# Truly Random
csharp enum
Retirar valores das tags de um XML padrão TISS/ANS SIB
12
Pizzas&Tuples&Golden-Medal
Teste
dsda
Recursion
Hei
if Two Words Are Anagrams of Each Other