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
d2
day2
int42
_
c _
ws_
4
c 4
d4
3
c 3
d3
day3
int43
< Source String
What to click?  extract any integer in this position
extract this integer (2006) in this position
 
3Python 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 
 
#!/usr/bin/python
# URL that generated this code:
# http://txt2re.com/index-python.php3?s=42%2043&2&6&9999

import re

txt='42 43'

re1=''	#  1
re2='.*?'	# Non-greedy match on filler
re3='\\d'	# Uninteresting: d
re4='(\\d)'	# Any Single Digit 1
re5='.*?'	# Non-greedy match on filler
re6='(\\d+)'	# Integer Number 1

rg = re.compile(re1+re2+re3+re4+re5+re6,re.IGNORECASE|re.DOTALL)
m = rg.search(txt)
if m:
    1=m.group(1)
    d1=m.group(2)
    int1=m.group(3)
    print "("+1+")"+"("+d1+")"+"("+int1+")"+"\n"

#-----
# Paste the code into a new python file. Then in Unix:'
# $ python x.py 
#-----
 
 
 
 
Feedback
:: 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
::  Mon, 25 May 2015 09:48AM
::  Mon, 25 May 2015 10:05AM
 
  home     faq              ©2006 mark james ennis