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
1
c 1
d1
day1
int1
.
c .
1
c 1
d1
day1
int1
.
c .
1
c 1
d1
day1
int1
.
c .
1
c 1
d1
day1
int1
float1.1
ipaddress
_
c _
ws_
-
c -
_
c _
ws_
b
c b
wb
o
c o
wo
b
c b
wb
varbob
word
_
c _
ws_
[
c [
1
c 1
d1
6
c 6
d6
day16
int16
/
c /
M
c M
wM
a
c a
wa
r
c r
wr
usstatear
varMar
wordMar
monthMar
/
c /
2
c 2
d2
0
c 0
d0
0
c 0
d0
9
c 9
d9
day09
year2009
int2009
unixpath/Mar/2009
ddmmmyyyy
:
c :
1
c 1
d1
3
c 3
d3
day13
int13
:
c :
1
c 1
d1
4
c 4
d4
day14
int14
:
c :
1
c 1
d1
5
c 5
d5
day15
int15
_
c _
ws_
-
c -
0
c 0
d0
8
c 8
d8
0
c 0
d0
0
c 0
d0
day00
int0800
signed_int-0800
]
c ]
sbraces[16/Mar/2009:13:14:15_-0800]
_
c _
ws_
"
c "
G
c G
wG
E
c E
wE
T
c T
wT
varGET
wordGET
_
c _
ws_
/
c /
g
c g
wg
i
c i
wi
b
c b
wb
b
c b
wb
s
c s
ws
vargibbs
wordgibbs
.
c .
g
c g
wg
i
c i
wi
f
c f
wf
vargif
wordgif
filegibbs.gif
fqdngibbs.gif
unixpath/gibbs.gif
_
c _
ws_
H
c H
wH
T
c T
wT
T
c T
wT
P
c P
wP
varHTTP
wordHTTP
/
c /
1
c 1
d1
day1
int1
.
c .
0
c 0
d0
day0
int0
float1.0
unixpath
"
c "
string"GET_/gibbs.gif_HTTP/1.0"
_
c _
ws_
2
c 2
d2
0
c 0
d0
0
c 0
d0
day00
int200
_
c _
ws_
5
c 5
d5
6
c 6
d6
4
c 4
d4
8
c 8
d8
day8
int5648
< Source String
What to click?  extract any integer in this position
extract this integer (2006) in this position
 
3Javascript 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-javascript.php3?s=1.1.1.1%20-%20bob%20[16/Mar/2009:13:14:15%20-0800]%20%22GET%20/gibbs.gif%20HTTP/1.0%22%20200%205648&8&25&3&16 -->

<html>
  <body>
    <script language=javascript>
      var txt='1.1.1.1 - bob [16/Mar/2009:13:14:15 -0800] "GET /gibbs.gif HTTP/1.0" 200 5648';

      var re1='((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(?![\\d])';	// IPv4 IP Address 1
      var re2='.*?';	// Non-greedy match on filler
      var re3='((?:[a-z][a-z]+))';	// Word 1
      var re4='.*?';	// Non-greedy match on filler
      var re5='((?:(?:[0-2]?\\d{1})|(?:[3][01]{1}))[-:\\/.](?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Sept|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)[-:\\/.](?:(?:[1]{1}\\d{1}\\d{1}\\d{1})|(?:[2]{1}\\d{3})))(?![\\d])';	// DDMMMYYYY 1
      var re6='.*?';	// Non-greedy match on filler
      var re7='(?:\\/[\\w\\.\\-]+)+';	// Uninteresting: unixpath
      var re8='.*?';	// Non-greedy match on filler
      var re9='((?:\\/[\\w\\.\\-]+)+)';	// Unix Path 1

      var p = new RegExp(re1+re2+re3+re4+re5+re6+re7+re8+re9,["i"]);
      var m = p.exec(txt);
      if (m != null)
      {
          var ipaddress1=m[1];
          var word1=m[2];
          var ddmmmyyyy1=m[3];
          var unixpath1=m[4];
          document.write("("+ipaddress1.replace(/</,"&lt;")+")"+"("+word1.replace(/</,"&lt;")+")"+"("+ddmmmyyyy1.replace(/</,"&lt;")+")"+"("+unixpath1.replace(/</,"&lt;")+")"+"\n");
      }
    </script>
  </body>
</html>

<!-- -->
<!-- Paste the code into a file that can be served by your web server -->
<!-- or into a local file that can be read by your browser -->
<!-- -->
 
 
 
 
Feedback
kostas:: Your tool is awesome!Fri, 5 Dec 2014 11:53AM
:: oh snizzzzleFri, 5 Dec 2014 04:54PM
Thankful:: Thank you!Fri, 5 Dec 2014 06:23PM
Me:: COOOOLFri, 12 Dec 2014 12:20PM
Ashesh:: Amazing ">Sat, 13 Dec 2014 02:21PM
:: I love this system, but normal sentence won't auto generate.Sun, 14 Dec 2014 09:56AM
Alex:: Best tool i have ever seen for this sort of jobs !Mon, 15 Dec 2014 11:18PM
Justin:: NoiceTue, 16 Dec 2014 06:08AM
З¬ёз:: coolTue, 16 Dec 2014 06:20AM
:: Awesome tool!!!!!Tue, 16 Dec 2014 08:32AM
Anil:: Awesome!! Just what I wanted. Great job. Thank you !!!Tue, 16 Dec 2014 09:23AM
dsds:: PO BoxWed, 17 Dec 2014 11:29AM
::  Wed, 17 Dec 2014 10:44PM
::  Wed, 17 Dec 2014 10:44PM
xerxe6:: coolThu, 18 Dec 2014 03:06PM
:: stupid cuntsFri, 19 Dec 2014 02:04PM
:: Goodlike Tool!Fri, 19 Dec 2014 04:13PM
:: Godlike Tool!Fri, 19 Dec 2014 04:13PM
:: This tool is irreplaceable. Thank you.Fri, 19 Dec 2014 05:55PM
pnyayqquayw:: SfXibsZefmNNGkMon, 22 Dec 2014 12:39AM
::  Mon, 22 Dec 2014 05:29AM
859::  Mon, 22 Dec 2014 08:50AM
859::  Mon, 22 Dec 2014 08:50AM
dfw:: fMon, 22 Dec 2014 09:58AM
Anthelion:: Great tool! Cheers!Mon, 22 Dec 2014 12:14PM
ryixixg:: qJgMeMcLSTue, 23 Dec 2014 06:59AM
::  Tue, 23 Dec 2014 11:18AM
Edison Bustos:: One of the best web tools ...Thanks... and Happy Holydays!Tue, 23 Dec 2014 02:39PM
Андрей Викторович::  Tue, 23 Dec 2014 04:03PM
Okieman:: Best regex generator I've found so far; rock on!Wed, 24 Dec 2014 01:58AM
:: dsfdsfWed, 24 Dec 2014 05:57AM
::  Wed, 24 Dec 2014 06:30AM
sun2:: Nice tool. thx!Wed, 24 Dec 2014 11:24AM
Андрей Викторович::  Wed, 24 Dec 2014 07:26PM
::  Thu, 25 Dec 2014 04:15AM
pqxcawapm:: rAsERYsfgLTdtkSThu, 25 Dec 2014 05:58AM
Dan:: Saved me a lot of times!Thu, 25 Dec 2014 04:14PM
Dan:: Saved me a lot of times!Thu, 25 Dec 2014 04:19PM
Dan:: Saved me a lot of times!Thu, 25 Dec 2014 04:20PM
::  Thu, 25 Dec 2014 04:21PM
::  Thu, 25 Dec 2014 04:22PM
pioshate:: thanksThu, 25 Dec 2014 04:25PM
::  Thu, 25 Dec 2014 04:25PM
::  Thu, 25 Dec 2014 04:25PM
 
  home     faq              ©2006 mark james ennis