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
14
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 _
ws_
"
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&-13&-10&-1
$txt='14:Mar:2015 "This is an Example!"';
$re1='(14)';	# Day 1
$re2='.*?';	# Non-greedy match on filler
$re3='(Mar)';	# Word 1
$re4='.*?';	# Non-greedy match on filler
$re5='("This is an Example!")';	# Double Quote String 1
$re=$re1.$re2.$re3.$re4.$re5;
if ($txt =~ m/$re/is)
{
    $day1=$1;
    $word1=$2;
    $string1=$3;
    print "($day1) ($word1) ($string1) \n";
}
#-----
# Paste the code into a new perl file. Then in Unix:
# $ perl x.pl 
#-----
 
 
 
 
Feedback
123,123::  Mon, 4 May 2015 07:30AM
�ط����ط�:: ������Mon, 4 May 2015 08:40AM
::  Mon, 4 May 2015 08:57PM
::  Tue, 5 May 2015 01:48AM
::  Tue, 5 May 2015 07:48AM
webfixnow.com:: Good for a quick fix.Tue, 5 May 2015 05:18PM
Sysadmin:: Nice!!Wed, 6 May 2015 12:54AM
:: 6837.27Wed, 6 May 2015 03:00AM
::  Wed, 6 May 2015 08:35AM
::  Wed, 6 May 2015 08:51AM
uu:: 7Wed, 6 May 2015 08:51AM
::  Wed, 6 May 2015 01:25PM
woowoo:: woohoo!Wed, 6 May 2015 04:24PM
:: Nice !! Wed, 6 May 2015 05:33PM
:: {ts '2014-06-20 09:35:00'}Thu, 7 May 2015 01:05AM
Ϭ��:: Ϭ��iaThu, 7 May 2015 02:24AM
::  Thu, 7 May 2015 03:32AM
asfasf:: asdasdThu, 7 May 2015 10:20AM
::  Thu, 7 May 2015 01:16PM
::  Thu, 7 May 2015 01:16PM
error:: good jobThu, 7 May 2015 01:16PM
pompedu:: :DThu, 7 May 2015 02:13PM
pompedu:: :DThu, 7 May 2015 02:15PM
::  Thu, 7 May 2015 05:31PM
:: SDFSThu, 7 May 2015 05:31PM
::  Thu, 7 May 2015 05:32PM
::  Fri, 8 May 2015 06:55AM
::  Fri, 8 May 2015 07:52AM
::  Fri, 8 May 2015 01:16PM
Suckme:: PATO PATO PATO CUA!PATO PATO PATO CUA!Fri, 8 May 2015 01:49PM
::  Sat, 9 May 2015 01:43AM
wtf:: is thisSat, 9 May 2015 03:30AM
:: alert('mmmmmmm I love regex mmmm');Sat, 9 May 2015 03:31AM
::  Sat, 9 May 2015 04:35AM
:: alert('');Sat, 9 May 2015 07:01AM
::  Sat, 9 May 2015 07:26AM
:: alert(123);Sun, 10 May 2015 08:47PM
::  Mon, 11 May 2015 03:46AM
::  Mon, 11 May 2015 08:17AM
zx:: nice��Mon, 11 May 2015 08:18AM
::  Mon, 11 May 2015 10:26AM
[attach]23[attach]::  Mon, 11 May 2015 11:13AM
::  Tue, 12 May 2015 02:36AM
::  Tue, 12 May 2015 02:45AM
 
  home     faq              ©2006 mark james ennis