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
2
day2
int42
_
 _
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&-10&-6

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

  Dim re1 As String
  re1 =".*?"	'Non-greedy match on filler
  Dim re2 As String
  re2 ="(2)"	'Any Single Digit 1
  Dim re3 As String
  re3 ="( )"	'Any Single Character 1
  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 d1
      d1=m.Item(0).SubMatches.Item(0)
      Dim c1
      c1=m.Item(0).SubMatches.Item(1)
      Dim int1
      int1=m.Item(0).SubMatches.Item(2)
      MsgBox("("+d1+")"+"("+c1+")"+"("+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
Kimihiro:: It's cool but not smart enoughTue, 7 Apr 2015 09:40AM
::  Wed, 8 Apr 2015 03:15AM
:: coolWed, 8 Apr 2015 03:16AM
yeti:: Very goodWed, 8 Apr 2015 03:17AM
Gholi:: Best:)Wed, 8 Apr 2015 09:21AM
::  Wed, 8 Apr 2015 12:09PM
Vaselir:: 5031f06cb9aaf10295a17fca86ac0644Wed, 8 Apr 2015 12:09PM
ключи nod32 5.2 9:: And how much?, Wed, 8 Apr 2015 08:52PM
:: #wutWed, 8 Apr 2015 11:23PM
::  Thu, 9 Apr 2015 03:28PM
[a-zA-Z_$][\\w$]*::  Thu, 9 Apr 2015 05:29PM
\"(\\w+)\"\\s::  Fri, 10 Apr 2015 12:40AM
ключи для nod32 64:: Where to get yourself the same?, Fri, 10 Apr 2015 06:39AM
nod32 скачать:: What is this?, Fri, 10 Apr 2015 02:29PM
nod32 скачать:: What is this?, Fri, 10 Apr 2015 02:29PM
nod32 ключи 2011:: original news, Fri, 10 Apr 2015 02:29PM
:: thank you for this useful tool, an inverse generator would be nice as well.Fri, 10 Apr 2015 06:04PM
'\d{4}\-\d{1,9}'::  Fri, 10 Apr 2015 08:18PM
::  Sun, 12 Apr 2015 10:02AM
BKRhqOrFmLmKjfyDwS:: jXvbZi 6.txt;2;8Sun, 12 Apr 2015 01:16PM
:: ֱDirect Supervisors OpinionMon, 13 Apr 2015 04:11AM
:: 128Mb,128MB,512Mb,256Mb,1Gb,2Gb,5Gb,6Gb ,8Gb,8GB,10Gb,15Gb,16Gb,16GB,20Gb,30Gb,32Gb,32GB,40Gb,60Gb,60GB,64Gb,64GB,80Gb,120GbMon, 13 Apr 2015 08:17AM
:: СTue, 14 Apr 2015 03:23AM
::  Tue, 14 Apr 2015 04:27AM
::  Tue, 14 Apr 2015 07:04AM
скачать книгу 1q84:: Why is everything so difficult?, Tue, 14 Apr 2015 07:34AM
::  Tue, 14 Apr 2015 08:54AM
::  Tue, 14 Apr 2015 08:57AM
f000::  Wed, 15 Apr 2015 06:09AM
::  Wed, 15 Apr 2015 06:35AM
:: What about negative lookaheads (?!pattern) to NOT match a special word groupWed, 15 Apr 2015 08:33AM
::  Wed, 15 Apr 2015 10:53AM
@2006 mark James cbbis:: iWed, 15 Apr 2015 02:21PM
::  Wed, 15 Apr 2015 02:21PM
::  Thu, 16 Apr 2015 09:20PM
::  Fri, 17 Apr 2015 02:54AM
fh:: 45Fri, 17 Apr 2015 06:03AM
010-63734030::  Fri, 17 Apr 2015 06:22AM
::  Fri, 17 Apr 2015 07:45AM
eeee:: dddFri, 17 Apr 2015 10:13AM
:: 999.999.999-99Fri, 17 Apr 2015 06:19PM
::  Fri, 17 Apr 2015 07:29PM
::  Sat, 18 Apr 2015 06:16AM
::  Sat, 18 Apr 2015 11:20PM
 
  home     faq              ©2006 mark james ennis