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
理漯彘::  Thu, 11 Sep 2014 06:51PM
:: +49 (9879) 789568658Thu, 11 Sep 2014 07:25PM
it's me:: lame regex generator. worthlessFri, 12 Sep 2014 01:08AM
:: 2321dsfaasFri, 12 Sep 2014 03:13AM
swagoverflow:: simply the bestFri, 12 Sep 2014 07:01AM
理漯彘 妈牝铕钼梓::  Fri, 12 Sep 2014 09:40AM
www.baidu.com/link?url=::  Fri, 12 Sep 2014 03:15PM
www.baidu.com/link?url=::  Fri, 12 Sep 2014 03:17PM
www.baidu.com/link?url=::  Fri, 12 Sep 2014 03:18PM
中国:: 不错,到些一游!Sat, 13 Sep 2014 07:44AM
中国:: 不错,到些一游!Sat, 13 Sep 2014 07:44AM
lqlyybctfn:: sVGDWVUHeZJQAcRvHPSat, 13 Sep 2014 09:55AM
::  Sat, 13 Sep 2014 08:29PM
dmitry:: that a cool tool thanks :)!Sat, 13 Sep 2014 09:48PM
:: ");alert("fuck you");Sun, 14 Sep 2014 02:35AM
理漯彘 妈牝铕钼梓::  Sun, 14 Sep 2014 03:30PM
理漯彘 妈牝铕钼梓::  Sun, 14 Sep 2014 07:31PM
oi:: javascript:alert("fix me");Mon, 15 Sep 2014 10:50AM
::  Tue, 16 Sep 2014 05:35AM
:: you guys are fucking losers, piss off with your inject attempts.Tue, 16 Sep 2014 06:47AM
::  Tue, 16 Sep 2014 08:07AM
:: NOT HELPFUL !!!Tue, 16 Sep 2014 08:07AM
:: 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
::  Tue, 16 Sep 2014 11:25AM
:: @[User:1638|Sushant Dua]​​ Tue, 16 Sep 2014 11:38AM
Geek AK:: ArgentinaaWed, 17 Sep 2014 04:53AM
ET:: Saved my dayWed, 17 Sep 2014 07:37AM
:: javascript:alert("fix me");Wed, 17 Sep 2014 01:04PM
:: javascript:alert("fix me");Wed, 17 Sep 2014 01:05PM
88::  Wed, 17 Sep 2014 02:12PM
Brazilian Guy:: Don't work for me.Wed, 17 Sep 2014 08:31PM
::  javascript:alert("fix me");Thu, 18 Sep 2014 05:07PM
as:: safFri, 19 Sep 2014 04:24AM
:: javascript:alert("fix me");Fri, 19 Sep 2014 07:22AM
::  Fri, 19 Sep 2014 07:22AM
::  Fri, 19 Sep 2014 07:22AM
::  Fri, 19 Sep 2014 07:22AM
::  Fri, 19 Sep 2014 07:22AM
::  Fri, 19 Sep 2014 07:22AM
::  Fri, 19 Sep 2014 07:22AM
::  Fri, 19 Sep 2014 07:22AM
sasasasa::  Fri, 19 Sep 2014 01:16PM
Paul:: Brilliant! Bookmarked. :o)Fri, 19 Sep 2014 04:23PM
MarkyMark:: Please add Powershell as a languageFri, 19 Sep 2014 09:40PM
 
  home     faq              ©2006 mark james ennis