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
9
c 9
d9
2
c 2
d2
day2
.
c .
1
c 1
d1
6
c 6
d6
8
c 8
d8
day8
.
c .
1
c 1
d1
0
c 0
d0
day10
.
c .
1
c 1
d1
1
c 1
d1
day11
float10.11
ddmmyy8.10.11
yymmdd68.10.11
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
/
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
unixpath/Mar/2009
ddmmmyyyy
:
c :
1
c 1
d1
3
c 3
d3
day13
:
c :
1
c 1
d1
4
c 4
d4
day14
:
c :
1
c 1
d1
5
c 5
d5
day15
_
c _
ws_
-
c -
0
c 0
d0
8
c 8
d8
0
c 0
d0
0
c 0
d0
day00
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
.
c .
0
c 0
d0
day0
float1.0
unixpath/1.0
"
c "
string"GET_/gibbs.gif_HTTP/1.0"
_
c _
ws_
2
c 2
d2
0
c 0
d0
0
c 0
d0
day00
_
c _
ws_
5
c 5
d
6
c 6
d
4
c 4
d
8
c 8
d
day8
< 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=192.168.10.11%20-%20bob%20[16/Mar/2009:13:14:15%20-0800]%20%22GET%20/gibbs.gif%20HTTP/1.0%22%20200%205648&3&23&4&100&103&98&106 -->

<html>
  <body>
    <script language=javascript>
      var txt='192.168.10.11 - 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='\\d';	// Uninteresting: d
      var re8='.*?';	// Non-greedy match on filler
      var re9='\\d';	// Uninteresting: d
      var re10='.*?';	// Non-greedy match on filler
      var re11='\\d';	// Uninteresting: d
      var re12='.*?';	// Non-greedy match on filler
      var re13='\\d';	// Uninteresting: d
      var re14='.*?';	// Non-greedy match on filler
      var re15='\\d';	// Uninteresting: d
      var re16='.*?';	// Non-greedy match on filler
      var re17='\\d';	// Uninteresting: d
      var re18='.*?';	// Non-greedy match on filler
      var re19='\\d';	// Uninteresting: d
      var re20='.*?';	// Non-greedy match on filler
      var re21='\\d';	// Uninteresting: d
      var re22='.*?';	// Non-greedy match on filler
      var re23='\\d';	// Uninteresting: d
      var re24='.*?';	// Non-greedy match on filler
      var re25='\\d';	// Uninteresting: d
      var re26='.*?';	// Non-greedy match on filler
      var re27='\\d';	// Uninteresting: d
      var re28='.*?';	// Non-greedy match on filler
      var re29='\\d';	// Uninteresting: d
      var re30='.*?';	// Non-greedy match on filler
      var re31='\\d';	// Uninteresting: d
      var re32='.*?';	// Non-greedy match on filler
      var re33='\\d';	// Uninteresting: d
      var re34='.*?';	// Non-greedy match on filler
      var re35='\\d';	// Uninteresting: d
      var re36='.*?';	// Non-greedy match on filler
      var re37='(\\d)';	// Any Single Digit 1
      var re38='(\\d)';	// Any Single Digit 2
      var re39='(\\d)';	// Any Single Digit 3
      var re40='(\\d)';	// Any Single Digit 4

      var p = new RegExp(re1+re2+re3+re4+re5+re6+re7+re8+re9+re10+re11+re12+re13+re14+re15+re16+re17+re18+re19+re20+re21+re22+re23+re24+re25+re26+re27+re28+re29+re30+re31+re32+re33+re34+re35+re36+re37+re38+re39+re40,["i"]);
      var m = p.exec(txt);
      if (m != null)
      {
          var ipaddress1=m[1];
          var word1=m[2];
          var ddmmmyyyy1=m[3];
          var d1=m[4];
          var d2=m[5];
          var d3=m[6];
          var d4=m[7];
          document.write("("+ipaddress1.replace(/</,"&lt;")+")"+"("+word1.replace(/</,"&lt;")+")"+"("+ddmmmyyyy1.replace(/</,"&lt;")+")"+"("+d1.replace(/</,"&lt;")+")"+"("+d2.replace(/</,"&lt;")+")"+"("+d3.replace(/</,"&lt;")+")"+"("+d4.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
:: 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
:: Is the source availableFri, 22 May 2015 11:59PM
::  Sat, 23 May 2015 10:18PM
::  Sat, 23 May 2015 11:19PM
d:: dSun, 24 May 2015 11:56AM
::  Sun, 24 May 2015 02:48PM
:: alert(Vulnerable Site);Sun, 24 May 2015 02:48PM
 
  home     faq              ©2006 mark james ennis