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
4
c 4
d4
day14
int14
:
c :
M
c M
wM
a
c a
wa
r
c r
wr
usstatear
varMar
Mar
monthMar
:
c :
2
c 2
d2
0
c 0
d0
1
c 1
d1
5
c 5
d5
day15
year2015
int2015
ddmmmyyyy14:Mar:2015
_
c _
_
"
c "
T
c T
wT
h
c h
wh
i
c i
wi
s
c s
ws
varThis
wordThis
_
c _
ws_
i
c i
wi
s
c s
ws
varis
wordis
_
c _
ws_
a
c a
wa
n
c n
wn
varan
wordan
_
c _
ws_
E
c E
wE
x
c x
wx
a
c a
wa
m
c m
wm
p
c p
wp
l
c l
wl
e
c e
we
varExample
wordExample
!
c !
"
c "
"This_is_an_Example!"
< Source String
What to click?  extract any integer in this position
extract this integer (2006) in this position
 
3Perl 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/perl
# URL that generated this code:
# http://txt2re.com/index.php3?s=14:Mar:2015%20%22This%20is%20an%20Example!%22&-20&-1&-10
$txt='14:Mar:2015 "This is an Example!"';
$re1='.*?';	# Non-greedy match on filler
$re2='(Mar)';	# Word 1
$re3='.*?';	# Non-greedy match on filler
$re4='( )';	# White Space 1
$re5='("This is an Example!")';	# Double Quote String 1
$re=$re1.$re2.$re3.$re4.$re5;
if ($txt =~ m/$re/is)
{
    $word1=$1;
    $ws1=$2;
    $string1=$3;
    print "($word1) ($ws1) ($string1) \n";
}
#-----
# Paste the code into a new perl file. Then in Unix:
# $ perl x.pl 
#-----
 
 
 
 
Feedback
::  Sat, 30 May 2015 01:17AM
Mike:: not really usefullSun, 31 May 2015 06:20PM
Gary:: Excellent tool! Mon, 1 Jun 2015 12:36AM
john:: Nice! Does it support IPv6 ?Mon, 1 Jun 2015 06:46AM
:: need plsql versionMon, 1 Jun 2015 09:34AM
::  Mon, 1 Jun 2015 09:35AM
::  Mon, 1 Jun 2015 10:08AM
Kr�ger:: awesome!Mon, 1 Jun 2015 10:55AM
::  Mon, 1 Jun 2015 04:53PM
::  Mon, 1 Jun 2015 06:28PM
:: rreMon, 1 Jun 2015 06:28PM
:: sexMon, 1 Jun 2015 06:28PM
::  Mon, 1 Jun 2015 06:28PM
::  Tue, 2 Jun 2015 12:49PM
::  Tue, 2 Jun 2015 01:40PM
An Intern:: Very UsefulTue, 2 Jun 2015 08:58PM
::  Tue, 2 Jun 2015 09:16PM
Santi GG:: A+++ tool !! CongratulationsTue, 2 Jun 2015 09:17PM
:: makes the poo fart if you know what i meanTue, 2 Jun 2015 11:00PM
kevin:: �dz�����Wed, 3 Jun 2015 04:33AM
::  Wed, 3 Jun 2015 10:43AM
:: hahaWed, 3 Jun 2015 12:20PM
:: A+++++++++Wed, 3 Jun 2015 08:56PM
::  Wed, 3 Jun 2015 09:44PM
::::  Wed, 3 Jun 2015 09:44PM
::  Wed, 3 Jun 2015 09:44PM
::  Wed, 3 Jun 2015 09:44PM
LOGIN::  Thu, 4 Jun 2015 04:37PM
::  Thu, 4 Jun 2015 06:14PM
::  Fri, 5 Jun 2015 02:53AM
::  Fri, 5 Jun 2015 02:53AM
:: THANKSFri, 5 Jun 2015 08:55AM
::  Fri, 5 Jun 2015 09:42AM
::  Fri, 5 Jun 2015 09:42AM
::  Fri, 5 Jun 2015 09:42AM
::  Fri, 5 Jun 2015 09:42AM
::  Fri, 5 Jun 2015 08:22PM
::  Sat, 6 Jun 2015 02:45AM
::  Sat, 6 Jun 2015 03:08AM
:: 'Sat, 6 Jun 2015 06:43AM
:: '>Sat, 6 Jun 2015 06:43AM
:: greatSat, 6 Jun 2015 08:19PM
Me:: I'm a regex expertSat, 6 Jun 2015 10:56PM
::  Sat, 6 Jun 2015 10:56PM
 
  home     faq              ©2006 mark james ennis