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
d4
2
c 2
d2
day2
42
_
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
 
3Visual Basic 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-vb.php3?s=42%2043&2&8&6&-1

Imports System.Text.RegularExpressions
Module Module1

  Sub Main
    Dim txt As String ="42 43"

    Dim re1 As String="(42)"	'Integer Number 1
    Dim re2 As String="(\d)"	'Any Single Digit 1
    Dim re3 As String=".*?"	'Non-greedy match on filler
    Dim re4 As String="(\d+)"	'Integer Number 2

    Dim r As Regex = new Regex(re1+re2+re3+re4,RegexOptions.IgnoreCase Or RegexOptions.Singleline)
    Dim m As Match = r.Match(txt)
    If (m.Success) Then
        Dim int1=m.Groups(1)
        Dim d1=m.Groups(2)
        Dim int2=m.Groups(3)
        Console.WriteLine("("+int1.ToString()+")"+"("+d1.ToString()+")"+"("+int2.ToString()+")"+"")
    End If
    Console.ReadLine()
  End Sub
End Module

'-----
' Paste the code into a new Console Application
'-----
 
 
 
 
Feedback
:: not badWed, 3 Sep 2014 12:02PM
gao:: Good Work..!Wed, 3 Sep 2014 02:23PM
Chew:: Hi! Thanks for the useful tool! Just one thing: try using your csv option when the csv terms are enclosed in quotes and there's a comma inside any of them...Thu, 4 Sep 2014 10:17AM
:: extremely confusing interface. Cannot figure out how to use this. Writing regex myself is easier.Thu, 4 Sep 2014 03:20PM
:: excellentFri, 5 Sep 2014 03:09PM
:: Muchas gracias por publicar tu trabajo :DFri, 5 Sep 2014 03:37PM
Genesio:: too clever! :-)Fri, 5 Sep 2014 04:12PM
:: It's fucking useful!Sat, 6 Sep 2014 05:11AM
Al:: EhhhhhhMon, 8 Sep 2014 03:48PM
Howl:: Awesome.Tue, 9 Sep 2014 06:19PM
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 10:34AM
I:: Love herThu, 11 Sep 2014 10:34AM
amil:: eman reh siThu, 11 Sep 2014 11:42AM
m:: wow this is sick!Thu, 11 Sep 2014 02:30PM
swagoverflow:: simply the bestFri, 12 Sep 2014 07:01AM
dmitry:: that a cool tool thanks :)!Sat, 13 Sep 2014 09:48PM
:: 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
Geek AK:: ArgentinaaWed, 17 Sep 2014 04:53AM
ET:: Saved my dayWed, 17 Sep 2014 07:37AM
Brazilian Guy:: Don't work for me.Wed, 17 Sep 2014 08:31PM
Paul:: Brilliant! Bookmarked. :o)Fri, 19 Sep 2014 04:23PM
MarkyMark:: Please add Powershell as a languageFri, 19 Sep 2014 09:40PM
mo:: works perfectly for javaSat, 20 Sep 2014 01:07PM
Lawrence:: Amazing tool. Thanks!Tue, 23 Sep 2014 12:19PM
linux_user:: Can you please add support fro C++ using Qt?Tue, 23 Sep 2014 08:01PM
javauser:: how does this work?Thu, 25 Sep 2014 08:32PM
::  Fri, 26 Sep 2014 10:45AM
Pranav:: Amazing! Fri, 26 Sep 2014 01:41PM
::  Fri, 26 Sep 2014 02:00PM
uxzanechvof:: ZvOYnOOIbeLlxfddASat, 27 Sep 2014 12:27PM
Iannos:: Brilliant ideaSat, 27 Sep 2014 01:57PM
Totom3:: Love it, thanks so much :DSun, 28 Sep 2014 04:54AM
'or '1'='1' --'::  Sun, 28 Sep 2014 04:19PM
::  Sun, 28 Sep 2014 08:54PM
asd:: marked as failure correctMon, 29 Sep 2014 11:58AM
 ::::  Mon, 29 Sep 2014 02:04PM
 ::  Mon, 29 Sep 2014 02:04PM
::  Mon, 29 Sep 2014 02:17PM
Universal5:: Thank you! You saved me quite some time and a headache. :-)Mon, 29 Sep 2014 07:27PM
:: thank you!! well done! very usefulTue, 30 Sep 2014 05:05AM
:: Thats great sirTue, 30 Sep 2014 05:57AM
Андрей Викторович::  Tue, 30 Sep 2014 11:54AM
 
  home     faq              ©2006 mark james ennis