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
 4
d4
2
 2
d2
day2
int42
_
c _
_
4
c 4
d4
3
c 3
d3
day3
int
< 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=42%2043&2&-13&-5&-11

$txt='42 43';

$re1='(4)';	# Any Single Character 1
$re2='(2)';	# Any Single Character 2
$re3='( )';	# White Space 1
$re4='(\\d+)';	# Integer Number 1

$re=$re1.$re2.$re3.$re4;
if ($txt =~ m/$re/is)
{
    $c1=$1;
    $c2=$2;
    $ws1=$3;
    $int1=$4;
    print "($c1) ($c2) ($ws1) ($int1) \n";
}

#-----
# Paste the code into a new perl file. Then in Unix:
# $ perl x.pl 
#-----
 
 
 
 
Feedback
Boss:: Nice!Mon, 28 Jul 2014 08:05PM
:: it chokes on some html tags, such as "", it actually formats the output of the answer instead of showing up as part of the regular expressionWed, 30 Jul 2014 07:24AM
:: Simply ExcellentWed, 30 Jul 2014 01:01PM
mk:: Thanks a million!Wed, 30 Jul 2014 11:38PM
baws:: dis is awesum m8s. Thu, 31 Jul 2014 08:22AM
:: Why not for URL?Thu, 31 Jul 2014 08:07PM
:: YAS!Tue, 5 Aug 2014 03:52PM
cheers:: big earsTue, 5 Aug 2014 03:52PM
Love it - :: Any change we could get output to a string like this: ^(?\d{1,3})-.+$Tue, 5 Aug 2014 06:23PM
good work:: neat toolThu, 7 Aug 2014 09:34AM
:: Simply AmazingThu, 7 Aug 2014 04:26PM
:: Very nice indeed!!Thu, 7 Aug 2014 04:55PM
Dave:: Thanks a bunch, works really well.Thu, 7 Aug 2014 04:58PM
ChampaKeChucheNirale:: Dhanyavad bhaiyaThu, 7 Aug 2014 05:06PM
:-o :):: amazin! thank you! please Add utf8 Unicode support, Like "Persian" languageThu, 7 Aug 2014 09:13PM
:::: asd@asdFri, 8 Aug 2014 08:38AM
asdf:: passabene frereFri, 8 Aug 2014 09:52AM
Berokor:: This tools helps me. tyFri, 8 Aug 2014 10:24AM
Pat:: I love you nowFri, 8 Aug 2014 08:00PM
dwenaus:: aaaaaamazing!!!!!Sat, 9 Aug 2014 04:05AM
D:: ThanksMon, 11 Aug 2014 09:57PM
:: knowing is obsolete Tue, 12 Aug 2014 11:20AM
Lim:: Thank uTue, 12 Aug 2014 12:30PM
Pacho:: Super!!!Tue, 12 Aug 2014 02:20PM
pwnubs:: hahahaha how many noobs trying to inject somethingWed, 13 Aug 2014 12:53AM
Atrinax:: Thanks a lot! You made my day!Thu, 14 Aug 2014 07:28AM
:: This is awsome Thu, 14 Aug 2014 04:54PM
:: superThu, 14 Aug 2014 08:09PM
:: excellentFri, 15 Aug 2014 09:30AM
:: Thanks a lot ! Helped me out with a very complex file-content validation !!Fri, 15 Aug 2014 01:49PM
alert(lol):: alert(lol)Fri, 15 Aug 2014 02:26PM
thanks!:: you rock dude.Fri, 15 Aug 2014 11:17PM
nufuqn:: dJzPNnjpYSat, 16 Aug 2014 09:09AM
::  Sat, 16 Aug 2014 02:53PM
::  Mon, 18 Aug 2014 07:58AM
url::  Mon, 18 Aug 2014 11:27AM
:: or 1=1Mon, 18 Aug 2014 04:09PM
Sanic:: Brilliant, thanks a lot mate.Tue, 19 Aug 2014 07:29AM
::  Tue, 19 Aug 2014 12:44PM
:: haxlolorlaoflaoTue, 19 Aug 2014 12:45PM
:: thxWed, 20 Aug 2014 10:38AM
I :: LoveWed, 20 Aug 2014 01:26PM
Alim::  Wed, 20 Aug 2014 01:38PM
amil::  Wed, 20 Aug 2014 01:39PM
 
  home     faq              ©2006 mark james ennis