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
 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
 
3Cold Fusion 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-cf.php3?s=42%2043&2&10&-11 -->

<html>
  <body>
    <cfset txt='42 43'>

    <cfset re1='.*?'>	<!-- Non-greedy match on filler-->
    <cfset re2='(2)'>	<!-- Any Single Character 1-->
    <cfset re3='(.)'>	<!-- Any Single Character 2-->
    <cfset re4='(\d+)'>	<!-- Integer Number 1-->

    <cfset re = #re1#&#re2#&#re3#&#re4#>
    <cfset m = #REFindNoCase(#re#,#txt#,1,"TRUE")#>
    <cfif #ArrayLen(m.pos)# gt 1>
        <cfset c1=#Mid(txt,m.pos[2],m.len[2])#>
        <cfset c2=#Mid(txt,m.pos[3],m.len[3])#>
        <cfset int1=#Mid(txt,m.pos[4],m.len[4])#>
        <cfoutput>
          (#replace(c1,"<" ,"&lt;")#)(#replace(c2,"<" ,"&lt;")#)(#replace(int1,"<" ,"&lt;")#)
        </cfoutput>
    </cfif>
  </body>
</html>

<!-- -->
<!-- Paste the code into a file that can be served by your cold fusion web server -->
<!-- -->
 
 
 
 
Feedback
zk:: great work! super useful, thanks so much!!Wed, 29 May 2013 05:52PM
KisnardOnline:: perfect perfect perfect... get some ads on this site, so we can thank you moreWed, 29 May 2013 10:21PM
ShubhamGupta:: Saved my day!Wed, 29 May 2013 11:36PM
::  Thu, 30 May 2013 12:02AM
Astarte:: Awesome, just awesome!Thu, 30 May 2013 12:03AM
David Dawkins:: Excellent tool, where's the donate link? thank-you !!!Thu, 30 May 2013 02:58PM
:: not badThu, 30 May 2013 10:19PM
::  Fri, 31 May 2013 04:02AM
::  Fri, 31 May 2013 03:12PM
'""': '::  Fri, 31 May 2013 03:23PM
Maybemedic:: Great work. Saved time many times over for me..Fri, 31 May 2013 07:47PM
Scott:: WHATSun, 2 Jun 2013 07:39AM
:: Very cool. Thanx!Sun, 2 Jun 2013 10:13AM
Chinche:: I love you.Mon, 3 Jun 2013 03:41AM
baldo:: I don't get how it worls...Mon, 3 Jun 2013 10:49AM
Fasil:: Awesome..................................................Mon, 3 Jun 2013 11:01AM
:: aweosme3Mon, 3 Jun 2013 12:07PM
d3l:: Nice!Mon, 3 Jun 2013 01:58PM
::  Mon, 3 Jun 2013 02:39PM
Drasive:: This is confusing as hellMon, 3 Jun 2013 02:40PM
hora:: perfecto como lo amoMon, 3 Jun 2013 06:32PM
Marcus:: I'd like an option to search on multiple line input (textarea). Thanks!Sat, 8 Jun 2013 09:30AM
Alan:: good job manSun, 9 Jun 2013 03:55PM
:: alert('s')Mon, 10 Jun 2013 03:53AM
:: Awesome jobMon, 10 Jun 2013 11:16AM
:: This is regex heaven! good stuffMon, 10 Jun 2013 02:53PM
:: How can I limit the length of the digits or string?Tue, 11 Jun 2013 12:44PM
:: \d{#} replace '#' with how many digits you want to match.Tue, 11 Jun 2013 09:42PM
Ørez:: So helpful, thank you!Wed, 12 Jun 2013 05:47AM
sivy:: Great tool !! Thanx!Wed, 12 Jun 2013 03:48PM
:: My eyes.....Wed, 12 Jun 2013 09:15PM
Patric:: WehThu, 13 Jun 2013 04:41AM
easyCoder:: easy codingThu, 13 Jun 2013 12:11PM
martin:: but now what is the regex?what do i put between ^ and "Thu, 13 Jun 2013 12:13PM
Kosheyaka:: ÀWÅSÎÌÅ COMßADE!Thu, 13 Jun 2013 02:29PM
edgaroto:: estos comentarios... como q no cuadran!Thu, 13 Jun 2013 03:00PM
:: thanks, doggThu, 13 Jun 2013 09:32PM
Manivannan:: I love It........Fri, 14 Jun 2013 11:41AM
Àíäðåé Âèêòîðîâè÷::  Fri, 14 Jun 2013 08:07PM
Tecnowilliam:: Great web page and helpful... Thank youFri, 14 Jun 2013 08:57PM
Àíäðåé Âèêòîðîâè÷::  Mon, 17 Jun 2013 09:52AM
:: aaaTue, 18 Jun 2013 07:30AM
::  Wed, 19 Jun 2013 01:47AM
:: abcdefghijklmnñopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVXYZ Wed, 19 Jun 2013 01:49AM
 
  home     faq              ©2006 mark james ennis