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
day
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
 
3C++.net 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 
 
// URL that generated this code:
// http://txt2re.com/index-c++dotnet.php3?s=42%2043&2&3&5

#include "stdafx.h"
using namespace System;
using namespace System::Text::RegularExpressions;

int main()
{
  String^ txt="42 43";

  String^ re1=".*?";	// Non-greedy match on filler
  String^ re2="(?:(?:[0-2]?\\d{1})|(?:[3][01]{1}))(?![\\d])";	// Uninteresting: day
  String^ re3="((?:(?:[0-2]?\\d{1})|(?:[3][01]{1})))(?![\\d])";	// Day 1
  String^ re4="(\\s+)";	// White Space 1
  String^ re5="(\\d+)";	// Integer Number 1

  Regex^ r = gcnew Regex(re1+re2+re3+re4+re5,RegexOptions::IgnoreCase|RegexOptions::Singleline);
  Match^ m = r->Match(txt);
  if (m->Success)
  {
      String^ day1=m->Groups[1]->Captures[0]->ToString();
      String^ ws1=m->Groups[2]->Captures[0]->ToString();
      String^ int1=m->Groups[3]->Captures[0]->ToString();
      Console::Write("("+day1->ToString()+")"+"("+ws1->ToString()+")"+"("+int1->ToString()+")"+"\n");
  }
  Console::ReadLine();
}

//-----
// Paste the code into a new Console Application
//-----
 
 
 
 
Feedback
:: 999.999.999-99Fri, 17 Apr 2015 06:19PM
::  Fri, 17 Apr 2015 07:29PM
::  Sat, 18 Apr 2015 06:16AM
Андрей Викторович::  Sat, 18 Apr 2015 11:20PM
::  Sun, 19 Apr 2015 11:05AM
::  Mon, 20 Apr 2015 02:49AM
sss::  Mon, 20 Apr 2015 04:20AM
::  Mon, 20 Apr 2015 10:25AM
TANKS::  Patton ThanksMon, 20 Apr 2015 12:04PM
zzz::  Mon, 20 Apr 2015 04:38PM
:: thanks god%>_Tue, 21 Apr 2015 03:54AM
yarak:: yarakTue, 21 Apr 2015 05:36AM
:: sampleTue, 21 Apr 2015 11:03AM
Андрей Викторович::  Tue, 21 Apr 2015 04:56PM
:: jklWed, 22 Apr 2015 05:50AM
:: j.;.hglWed, 22 Apr 2015 05:50AM
:: where is regular expression generated???Wed, 22 Apr 2015 05:51AM
:: ghjgfhfjghWed, 22 Apr 2015 11:41AM
:: hhhhhhhhhhhhhhhhhhhhhhfghbnvmnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnmmmmmmmmmmmmmmmmmmmmmmmmmmmmmWed, 22 Apr 2015 11:41AM
::  Wed, 22 Apr 2015 04:40PM
::  Wed, 22 Apr 2015 05:53PM
:: testThu, 23 Apr 2015 09:07AM
ЈЁЈ©::  Thu, 23 Apr 2015 09:53AM
::  Thu, 23 Apr 2015 11:28AM
Apache/2.4.4 (Unix)::  Thu, 23 Apr 2015 11:49AM
::  Thu, 23 Apr 2015 11:51AM
llll:: llThu, 23 Apr 2015 04:42PM
client=DynGate::  Fri, 24 Apr 2015 11:08AM
EFWEF:: FWEFWEFFri, 24 Apr 2015 04:02PM
http:: localhostFri, 24 Apr 2015 06:08PM
Андрей Викторович::  Fri, 24 Apr 2015 08:44PM
::  Sat, 25 Apr 2015 03:56AM
tyrone:: ayy lmaoSun, 26 Apr 2015 04:51AM
test:: alert('test');Sun, 26 Apr 2015 07:13AM
::  Sun, 26 Apr 2015 07:40AM
::  Sun, 26 Apr 2015 11:31AM
:: This is that good shitSun, 26 Apr 2015 05:26PM
oh:: niceMon, 27 Apr 2015 01:13AM
::  Mon, 27 Apr 2015 09:39AM
:: ХЫїЫЈєMon, 27 Apr 2015 09:39AM
::  Mon, 27 Apr 2015 10:08AM
::  Mon, 27 Apr 2015 10:25AM
::  Mon, 27 Apr 2015 02:25PM
::  Tue, 28 Apr 2015 07:32AM
 
  home     faq              ©2006 mark james ennis