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 
d4
2
c 
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
 
3VB6 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-vb6.php3?s=42%2043&2&11&13

Private Sub Command1_Click()
  Dim txt As String
  txt ="42 43"

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

  Dim r As New RegExp
  r.Pattern = re1+re2+re3+re4
  r.IgnoreCase = True
  Dim m As MatchCollection
  Set m = r.Execute(txt)
  If m.Item(0).SubMatches.Count > 0 Then
      Dim c1
      c1=m.Item(0).SubMatches.Item(0)
      Dim c2
      c2=m.Item(0).SubMatches.Item(1)
      Dim int1
      int1=m.Item(0).SubMatches.Item(2)
      MsgBox("("+c1+")"+"("+c2+")"+"("+int1+")"+"")
  End If
End Sub

'-----
' To run this code:
' .Start Microsoft Visual Basic 6.0.
' .On the File menu, click New Project.
' .Click Standard Exe in the New Project dialog box, and then click OK.
' .On the Project menu, click References.
' .Double-click Microsoft VBScript Regular Expressions 5.5, and then click OK.
'   (If you can't find this option, download "Microsoft Windows Script 5.6"
'     from Microsoft)
' .In the toolbox, double-click CommandButton.
' .Double-click Command1 to open the Code window.
' .Paste the code above into the Command1_Click event handler:
'-----
 
 
 
 
Feedback
ESGI:: Merci tu es fabuleux.Mon, 18 May 2015 01:35PM
:: Thanks for this!Mon, 18 May 2015 03:26PM
:: alert("stop doing alerts")Tue, 19 May 2015 05:24AM
::  Tue, 19 May 2015 06:51AM
boost:: amazingTue, 19 May 2015 08:14AM
::  Tue, 19 May 2015 11:09AM
:: nice tool !Tue, 19 May 2015 12:09PM
:: asdTue, 19 May 2015 01:49PM
:: Magyar vagyok ments ki innen.Tue, 19 May 2015 01:50PM
Chuck::  Tue, 19 May 2015 01:50PM
::  Tue, 19 May 2015 02:10PM
:: sWed, 20 May 2015 06:49AM
:: alert(ôVulnerable Siteö); Wed, 20 May 2015 08:48AM
:: hey no alert anymore !! nice !Wed, 20 May 2015 08:48AM
::  Wed, 20 May 2015 09:21AM
::  Wed, 20 May 2015 09:48AM
....:: yooloWed, 20 May 2015 01:18PM
::  Wed, 20 May 2015 01:18PM
::  Wed, 20 May 2015 01:18PM
::  Wed, 20 May 2015 01:18PM
└Ýń­ňÚ ┬Ŕŕ˛ţ­ţÔŔ¸::  Wed, 20 May 2015 04:41PM
:: alert(ôVulnerable Siteö);Thu, 21 May 2015 04:54AM
::  Thu, 21 May 2015 10:16AM
:: alert(ôVulnerable Siteö);Thu, 21 May 2015 10:45AM
::  Thu, 21 May 2015 02:37PM
::  Thu, 21 May 2015 02:49PM
:: ===============3Thu, 21 May 2015 02:49PM
::  Thu, 21 May 2015 02:50PM
::  Thu, 21 May 2015 04:10PM
::  Thu, 21 May 2015 04:11PM
Jesus:: 8============DThu, 21 May 2015 07:36PM
::  Thu, 21 May 2015 09:27PM
::  Thu, 21 May 2015 11:35PM
::  Fri, 22 May 2015 02:47AM
::  Fri, 22 May 2015 03:09AM
:::: alert("Script ran!");Fri, 22 May 2015 11:28AM
Al Capone:: I Was HereFri, 22 May 2015 12:05PM
:: alert("Hello")Fri, 22 May 2015 01:46PM
:: alert("Script ran!");Fri, 22 May 2015 02:23PM
::  Fri, 22 May 2015 02:31PM
::  Fri, 22 May 2015 04:13PM
:: Nice :-) Where to donate the million? Is this open source? :)Fri, 22 May 2015 04:22PM
323:: weweFri, 22 May 2015 06:51PM
::  Fri, 22 May 2015 09:39PM
 
  home     faq              ©2006 mark james ennis