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 _
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&-22&-10&-1
$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='("This is an Example!")';	# Double Quote String 1
$re=$re1.$re2.$re3.$re4;
if ($txt =~ m/$re/is)
{
    $word1=$1;
    $string1=$2;
    print "($word1) ($string1) \n";
}
#-----
# Paste the code into a new perl file. Then in Unix:
# $ perl x.pl 
#-----
 
 
 
 
Feedback
::  Tue, 9 Jun 2015 06:31PM
Boston Globe:: Two thumbs up!!Tue, 9 Jun 2015 09:39PM
::  Wed, 10 Jun 2015 05:41AM
::  Wed, 10 Jun 2015 06:03AM
::  Wed, 10 Jun 2015 08:20AM
::  Wed, 10 Jun 2015 10:03AM
::  Wed, 10 Jun 2015 10:07AM
::  Wed, 10 Jun 2015 11:29AM
::  Wed, 10 Jun 2015 02:45PM
Robot Soldier:: Bleep Bloop, Maggots!Wed, 10 Jun 2015 06:18PM
Robrtplant:: Obrigado! Thank you!Wed, 10 Jun 2015 10:10PM
:: Awesome program! Very helpful indeed, Thank you.Thu, 11 Jun 2015 12:09AM
Bill Gates:: C#Thu, 11 Jun 2015 08:24AM
::  Thu, 11 Jun 2015 08:25AM
:: ::Thu, 11 Jun 2015 08:25AM
:: alert('lol');Thu, 11 Jun 2015 08:25AM
:: alert('lol');Thu, 11 Jun 2015 08:25AM
::  Thu, 11 Jun 2015 12:06PM
::  Thu, 11 Jun 2015 12:06PM
::  Thu, 11 Jun 2015 12:10PM
::  Thu, 11 Jun 2015 08:19PM
:::: alert('lol');Thu, 11 Jun 2015 08:19PM
::  Fri, 12 Jun 2015 03:24AM
::  Fri, 12 Jun 2015 08:26AM
::  Fri, 12 Jun 2015 08:43AM
::  Fri, 12 Jun 2015 09:26AM
bob:: saved my lifeFri, 12 Jun 2015 10:29AM
::  Fri, 12 Jun 2015 01:10PM
::  Fri, 12 Jun 2015 01:10PM
::  Fri, 12 Jun 2015 01:10PM
::  Fri, 12 Jun 2015 01:10PM
:: alert('lol');Fri, 12 Jun 2015 02:12PM
adga:: graciasFri, 12 Jun 2015 03:18PM
::  Fri, 12 Jun 2015 03:57PM
::  Fri, 12 Jun 2015 07:56PM
������::  Fri, 12 Jun 2015 08:46PM
:: alert("lol")Sat, 13 Jun 2015 12:43PM
::  Sat, 13 Jun 2015 08:29PM
::  Sat, 13 Jun 2015 08:29PM
::  Sat, 13 Jun 2015 08:29PM
:: alert("lol")Sat, 13 Jun 2015 08:30PM
:: Ha sibe coalam husse epne olplSat, 13 Jun 2015 08:31PM
Satan::  Sat, 13 Jun 2015 08:31PM
:: 666Sat, 13 Jun 2015 08:31PM
 
  home     faq              ©2006 mark james ennis