Advertisement
Guest User

RegEx

a guest
Feb 20th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3.                    
  4. public class Program
  5. {
  6.     public static void Main()
  7.     {
  8.          string txt="/*bilostaaa*/+++ ";
  9.  
  10.       string re1="((?:[a-z][a-z]+))";   // Word 1
  11.  
  12.       Regex r = new Regex(re1,RegexOptions.IgnoreCase|RegexOptions.Singleline);
  13.       Match m = r.Match(txt);
  14.       if (m.Success)
  15.       {
  16.             String word1=m.Groups[1].ToString();
  17.             Console.Write("["+word1.ToString()+"]"+"\n");
  18.       }
  19.       Console.ReadLine();
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement