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
4
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&-8
$txt='42 43';
$re1='(4)';	# Any Single Digit 1
$re2='.*?';	# Non-greedy match on filler
$re3='\\d+';	# Uninteresting: int
$re4='.*?';	# Non-greedy match on filler
$re5='(\\d+)';	# Integer Number 1
$re=$re1.$re2.$re3.$re4.$re5;
if ($txt =~ m/$re/is)
{
    $d1=$1;
    $int1=$2;
    print "($d1) ($int1) \n";
}
#-----
# Paste the code into a new perl file. Then in Unix:
# $ perl x.pl 
#-----
 
 
 
 
Feedback
::  Thu, 2 Apr 2015 10:35AM
abcd:: ãThu, 2 Apr 2015 10:35AM
::  Thu, 2 Apr 2015 10:43AM
::  Thu, 2 Apr 2015 03:02PM
:: include grep pattern matching please!!!Fri, 3 Apr 2015 04:48AM
::  Fri, 3 Apr 2015 06:27AM
sss:: ssssssssssssssssssFri, 3 Apr 2015 09:31AM
::  Fri, 3 Apr 2015 03:29PM
:: loooooolFri, 3 Apr 2015 03:29PM
::  Fri, 3 Apr 2015 03:30PM
:: $("body").css('color', 'yellow');Fri, 3 Apr 2015 03:32PM
:: fooSat, 4 Apr 2015 05:08PM
Vaselir:: 5031f06cb9aaf10295a17fca86ac0644Sun, 5 Apr 2015 05:54PM
yourMum:: Jesus approves!Sun, 5 Apr 2015 09:52PM
lol:: hiSun, 5 Apr 2015 10:06PM
::  Sun, 5 Apr 2015 10:06PM
:: >Sun, 5 Apr 2015 10:06PM
Vaselir:: 5031f06cb9aaf10295a17fca86ac0644Mon, 6 Apr 2015 05:05AM
::  Mon, 6 Apr 2015 10:03AM
::  Mon, 6 Apr 2015 01:35PM
::  Mon, 6 Apr 2015 07:43PM
::  Tue, 7 Apr 2015 12:50AM
::  Tue, 7 Apr 2015 09:36AM
Kimihiro:: It's cool but not smart enoughTue, 7 Apr 2015 09:40AM
::  Wed, 8 Apr 2015 03:15AM
:: coolWed, 8 Apr 2015 03:16AM
yeti:: Very goodWed, 8 Apr 2015 03:17AM
Gholi:: Best:)Wed, 8 Apr 2015 09:21AM
::  Wed, 8 Apr 2015 12:09PM
Vaselir:: 5031f06cb9aaf10295a17fca86ac0644Wed, 8 Apr 2015 12:09PM
ключи nod32 5.2 9:: And how much?, Wed, 8 Apr 2015 08:52PM
:: #wutWed, 8 Apr 2015 11:23PM
::  Thu, 9 Apr 2015 03:28PM
[a-zA-Z_$][\\w$]*::  Thu, 9 Apr 2015 05:29PM
\"(\\w+)\"\\s::  Fri, 10 Apr 2015 12:40AM
ключи для nod32 64:: Where to get yourself the same?, Fri, 10 Apr 2015 06:39AM
nod32 скачать:: What is this?, Fri, 10 Apr 2015 02:29PM
nod32 скачать:: What is this?, Fri, 10 Apr 2015 02:29PM
nod32 ключи 2011:: original news, Fri, 10 Apr 2015 02:29PM
:: thank you for this useful tool, an inverse generator would be nice as well.Fri, 10 Apr 2015 06:04PM
'\d{4}\-\d{1,9}'::  Fri, 10 Apr 2015 08:18PM
::  Sun, 12 Apr 2015 10:02AM
BKRhqOrFmLmKjfyDwS:: jXvbZi 6.txt;2;8Sun, 12 Apr 2015 01:16PM
:: ֱDirect Supervisors OpinionMon, 13 Apr 2015 04:11AM
 
  home     faq              ©2006 mark james ennis