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
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&5
$txt='42 43';
$re1='.*?';	# Non-greedy match on filler
$re2='(\\s+)';	# White Space 1
$re3='(\\d+)';	# Integer Number 1
$re=$re1.$re2.$re3;
if ($txt =~ m/$re/is)
{
    $ws1=$1;
    $int1=$2;
    print "($ws1) ($int1) \n";
}
#-----
# Paste the code into a new perl file. Then in Unix:
# $ perl x.pl 
#-----
 
 
 
 
Feedback
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
-1':: 1Fri, 8 Aug 2014 02:56AM
1:: -1'Fri, 8 Aug 2014 02:57AM
-1':: 1Fri, 8 Aug 2014 05:12AM
1:: -1'Fri, 8 Aug 2014 05:12AM
1:: 1Fri, 8 Aug 2014 05:12AM
::  Fri, 8 Aug 2014 08:38AM
:::: [email protected]Fri, 8 Aug 2014 08:38AM
asdf:: passabene frereFri, 8 Aug 2014 09:52AM
::  Fri, 8 Aug 2014 10:03AM
Berokor:: This tools helps me. tyFri, 8 Aug 2014 10:24AM
-1':: 1Fri, 8 Aug 2014 02:31PM
1:: -1'Fri, 8 Aug 2014 02:31PM
1:: 1Fri, 8 Aug 2014 02:31PM
dsdfghjkl:: sdfgfsdfhjklFri, 8 Aug 2014 07:17PM
Pat:: I love you nowFri, 8 Aug 2014 08:00PM
:: 11111111-1Fri, 8 Aug 2014 08:15PM
::  Sat, 9 Aug 2014 12:05AM
dwenaus:: aaaaaamazing!!!!!Sat, 9 Aug 2014 04:05AM
-1':: 1Sat, 9 Aug 2014 11:44AM
1:: -1'Sat, 9 Aug 2014 11:44AM
1:: 1Sat, 9 Aug 2014 11:44AM
1:: -1'Sat, 9 Aug 2014 12:24PM
1:: 1Sat, 9 Aug 2014 12:25PM
::  Sat, 9 Aug 2014 01:21PM
-1':: 1Sat, 9 Aug 2014 01:56PM
1:: -1'Sat, 9 Aug 2014 01:56PM
1:: 1Sat, 9 Aug 2014 01:56PM
-1':: 1Sat, 9 Aug 2014 05:02PM
1:: -1'Sat, 9 Aug 2014 05:02PM
1:: 1Sat, 9 Aug 2014 05:02PM
-1':: 1Sat, 9 Aug 2014 07:03PM
1:: -1'Sat, 9 Aug 2014 07:03PM
1:: 1Sat, 9 Aug 2014 07:03PM
1:: -1'Sun, 10 Aug 2014 08:22AM
1:: 1Sun, 10 Aug 2014 08:22AM
-1':: 1Sun, 10 Aug 2014 10:03AM
1:: -1'Sun, 10 Aug 2014 10:03AM
1:: 1Sun, 10 Aug 2014 10:03AM
-1':: 1Sun, 10 Aug 2014 02:50PM
1:: -1'Sun, 10 Aug 2014 02:50PM
::  Sun, 10 Aug 2014 04:17PM
 
  home     faq              ©2006 mark james ennis