txt 2 re
knowing is obsolete :: regular expression generator (perl php python java javascript coldfusion c c++ ruby vb vbscript j# c# c++.net vb.net)
 
 
 
Enter the string that you want to use a regular expression on:
1
   
 
Select the elements that you want to extract to run regular expression generator:
2
X
c X
wX
Y
c Y
wY
Z
c Z
wZ
varXYZ
word
-
 -
A
c 
wA
B
c 
wB
C
c 
wC
varABC
wordABC
-
 -
0
c 0
d
0
c 0
d
1
c 1
d
day01
int001
signed_int-001
< Source String
What to click?  extract any integer in this position
extract this integer (2006) in this position
 
3C# regular expression program that extracts the selected elements from the entered string:
Perl PHP Python Java Javascript ColdFusion C C++ Ruby VB VBScript J#.net [C#.net] C++.net VB.net 
 
// URL that generated this code:
// http://txt2re.com/index-csharp.php3?s=XYZ-ABC-001&4&22&23&24&-17&-18&14&15&16

using System;
using System.Text.RegularExpressions;

namespace ConsoleApplication1
{
  class Program
  {
    static void Main(string[] args)
    {
      string txt="XYZ-ABC-001";

      string re1="((?:[a-z][a-z]+))";	// Word 1
      string re2="(-)";	// Any Single Character 1
      string re3="(.)";	// Any Single Character 2
      string re4="(.)";	// Any Single Character 3
      string re5="(.)";	// Any Single Character 4
      string re6="(-)";	// Any Single Character 5
      string re7="(\\d)";	// Any Single Digit 1
      string re8="(\\d)";	// Any Single Digit 2
      string re9="(\\d)";	// Any Single Digit 3

      Regex r = new Regex(re1+re2+re3+re4+re5+re6+re7+re8+re9,RegexOptions.IgnoreCase|RegexOptions.Singleline);
      Match m = r.Match(txt);
      if (m.Success)
      {
            String word1=m.Groups[1].ToString();
            String c1=m.Groups[2].ToString();
            String c2=m.Groups[3].ToString();
            String c3=m.Groups[4].ToString();
            String c4=m.Groups[5].ToString();
            String c5=m.Groups[6].ToString();
            String d1=m.Groups[7].ToString();
            String d2=m.Groups[8].ToString();
            String d3=m.Groups[9].ToString();
            Console.Write("("+word1.ToString()+")"+"("+c1.ToString()+")"+"("+c2.ToString()+")"+"("+c3.ToString()+")"+"("+c4.ToString()+")"+"("+c5.ToString()+")"+"("+d1.ToString()+")"+"("+d2.ToString()+")"+"("+d3.ToString()+")"+"\n");
      }
      Console.ReadLine();
    }
  }
}

//-----
// Paste the code into a new Console Application
//-----
 
 
 
 
Feedback
anon:: Are you all kidding me?! This thing is worthlessFri, 5 Sep 2014 05:07PM
:: It's fucking useful!Sat, 6 Sep 2014 05:11AM
Al:: EhhhhhhMon, 8 Sep 2014 03:48PM
ricikj:: ygdfZuciUBDcHvKoBMon, 8 Sep 2014 09:16PM
理漯彘 妈牝铕钼梓::  Tue, 9 Sep 2014 07:49AM
@::  Tue, 9 Sep 2014 10:50AM
Howl:: Awesome.Tue, 9 Sep 2014 06:19PM
wtbjkg:: FUapGOOsKGBdzBmDJbUTue, 9 Sep 2014 08:19PM
::  Wed, 10 Sep 2014 04:40AM
gfpucoclw:: GnlZsZhtESAzThu, 11 Sep 2014 05:21AM
What:: Happened Thu, 11 Sep 2014 09:32AM
in :: Chicago on this day?Thu, 11 Sep 2014 09:33AM
Thank you:: Thank youThu, 11 Sep 2014 09:34AM
Thank you:: Thank youThu, 11 Sep 2014 10:34AM
I:: Love herThu, 11 Sep 2014 10:34AM
I:: Love herThu, 11 Sep 2014 10:37AM
amil:: eman reh siThu, 11 Sep 2014 11:42AM
::  Thu, 11 Sep 2014 02:29PM
m:: wow this is sick!Thu, 11 Sep 2014 02:30PM
理漯彘::  Thu, 11 Sep 2014 06:51PM
:: +49 (9879) 789568658Thu, 11 Sep 2014 07:25PM
it's me:: lame regex generator. worthlessFri, 12 Sep 2014 01:08AM
:: 2321dsfaasFri, 12 Sep 2014 03:13AM
swagoverflow:: simply the bestFri, 12 Sep 2014 07:01AM
理漯彘 妈牝铕钼梓::  Fri, 12 Sep 2014 09:40AM
www.baidu.com/link?url=::  Fri, 12 Sep 2014 03:15PM
www.baidu.com/link?url=::  Fri, 12 Sep 2014 03:17PM
www.baidu.com/link?url=::  Fri, 12 Sep 2014 03:18PM
中国:: 不错,到些一游!Sat, 13 Sep 2014 07:44AM
中国:: 不错,到些一游!Sat, 13 Sep 2014 07:44AM
lqlyybctfn:: sVGDWVUHeZJQAcRvHPSat, 13 Sep 2014 09:55AM
::  Sat, 13 Sep 2014 08:29PM
dmitry:: that a cool tool thanks :)!Sat, 13 Sep 2014 09:48PM
:: ");alert("fuck you");Sun, 14 Sep 2014 02:35AM
理漯彘 妈牝铕钼梓::  Sun, 14 Sep 2014 03:30PM
理漯彘 妈牝铕钼梓::  Sun, 14 Sep 2014 07:31PM
oi:: javascript:alert("fix me");Mon, 15 Sep 2014 10:50AM
::  Tue, 16 Sep 2014 05:35AM
:: you guys are fucking losers, piss off with your inject attempts.Tue, 16 Sep 2014 06:47AM
::  Tue, 16 Sep 2014 08:07AM
:: NOT HELPFUL !!!Tue, 16 Sep 2014 08:07AM
:: It compares character by character and does not give any generic result.. so basically REGEX given by u is specific to that particular string..Tue, 16 Sep 2014 08:08AM
::  Tue, 16 Sep 2014 11:25AM
:: @[User:1638|Sushant Dua]​​ Tue, 16 Sep 2014 11:38AM
 
  home     faq              ©2006 mark james ennis