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
4
c 4
4
2
 2
d2
day2
int42
_
c _
ws_
4
c 4
d4
3
c 3
d3
day3
int
< Source String
What to click?  extract any integer in this position
extract this integer (2006) in this position
 
3J# 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-jsharp.php3?s=42%2043&2&-11&-8

package ConsoleApplication1;
import System.Text.RegularExpressions.*;

public class Program
{
  public static void main(String[] args)
  {
    String txt="42 43";

    String re1="(4)";	// Any Single Digit 1
    String re2="(2)";	// Any Single Character 1
    String re3=".*?";	// Non-greedy match on filler
    String re4="(\\d+)";	// Integer Number 1

    Regex r = new Regex(re1+re2+re3+re4,RegexOptions.IgnoreCase|RegexOptions.Singleline);
    Match m = r.Match(txt);
    if (m.get_Success())
    {
        String d1=m.get_Groups().get_Item(1).toString();
        String c1=m.get_Groups().get_Item(2).toString();
        String int1=m.get_Groups().get_Item(3).toString();
        System.Console.Write("("+d1.toString()+")"+"("+c1.toString()+")"+"("+int1.toString()+")"+"\n");
    }
    System.Console.Read();
  }
}

//-----
// Paste the code into a new Console Application
//-----
 
 
 
 
Feedback
::  alert('hahahah');Sun, 21 Jun 2015 12:50PM
as:: lasSun, 21 Jun 2015 06:05PM
:: saved my assMon, 22 Jun 2015 07:12PM
:: eeeeeehhhhhhhhhhhhhhhhhh?????????????Mon, 22 Jun 2015 07:13PM
:: hiMon, 22 Jun 2015 08:54PM
::  Mon, 22 Jun 2015 11:03PM
.|.:: me lleva la vergaMon, 22 Jun 2015 11:03PM
.|.:: me lleva la vergaMon, 22 Jun 2015 11:03PM
:o):: thanksTue, 23 Jun 2015 03:36PM
11:: 11Tue, 23 Jun 2015 05:11PM
cheez-it:: yesTue, 23 Jun 2015 07:14PM
::  Tue, 23 Jun 2015 09:27PM
blandcramration:: fuck yeah, bitchin' dudeTue, 23 Jun 2015 09:27PM
::  Tue, 23 Jun 2015 10:49PM
::  Tue, 23 Jun 2015 10:49PM
::  Tue, 23 Jun 2015 10:49PM
::  Tue, 23 Jun 2015 10:49PM
::  Tue, 23 Jun 2015 10:49PM
zeeeepy:: this is awesommmmmmmmmmmmmTue, 23 Jun 2015 10:50PM
fabqjailcg:: LDiabyzjANWed, 24 Jun 2015 03:25AM
opxgajhd:: suJUBPrLdOFWMFqrWed, 24 Jun 2015 04:08AM
Radu:: many thanks for the AWESOME toolWed, 24 Jun 2015 06:18AM
thisguy:: this is a fantastic tool and I speak on behalf of mankind when I thank you for it.Wed, 24 Jun 2015 07:50AM
comentario::  Wed, 24 Jun 2015 03:43PM
::  Wed, 24 Jun 2015 11:42PM
::  Thu, 25 Jun 2015 10:35AM
::  Thu, 25 Jun 2015 02:12PM
goganavt:: coolThu, 25 Jun 2015 02:12PM
:-/:: cool but how to use itThu, 25 Jun 2015 06:25PM
:: amazing. thanksThu, 25 Jun 2015 11:54PM
:D:: great, but a little unintuitiveFri, 26 Jun 2015 02:00AM
test:: alert('haha');Fri, 26 Jun 2015 07:49AM
1|2|3|4|5:: 12345Fri, 26 Jun 2015 08:39AM
Anonymous:: Amazing!! Saved me 2 hours of learning and coding.Fri, 26 Jun 2015 05:21PM
d::  Sat, 27 Jun 2015 03:51AM
:: \Sat, 27 Jun 2015 03:51AM
:: <Sat, 27 Jun 2015 03:52AM
:: <script>alert("yeah")<\script>Sat, 27 Jun 2015 03:53AM
::  Mon, 29 Jun 2015 09:09AM
::  Mon, 29 Jun 2015 10:40PM
:: alert("yeah")Mon, 29 Jun 2015 11:50PM
:: alert("yeah")Mon, 29 Jun 2015 11:50PM
:: function(){alert("yeah")}();Mon, 29 Jun 2015 11:51PM
:: function(){alert("yeah")}();Mon, 29 Jun 2015 11:51PM
 
  home     faq              ©2006 mark james ennis