Regex: How to extract a particular pattern individually from a text?
<p>I am trying to extract a pattern using regular expression from a text shown bellow.</p>

<pre><code>to_timestamp('02-04-09 00:00:00.000000000','RR-MM-DD HH24:MI:SS.FF'),'REP00061    ',to_timestamp('08-05-30 07:27:36.000000000','RR-MM-DD HH24:MI:SS.FF'),
</code></pre>

<p>How can I write a regex in Python to extract following patterns individually?</p>

<pre><code>to_timestamp('02-04-09 00:00:00.000000000','RR-MM-DD HH24:MI:SS.FF')
to_timestamp('08-05-30 07:27:36.000000000','RR-MM-DD HH24:MI:SS.FF')
</code></pre>

<p>basically using pythex.org you can create your regex with ease.</p>

<p>for example :</p>

<pre><code>m = re.findall(r'(to_timestamp\(\'.*?\',\'.*? .*?\'\))',str)
</code></pre>

<p>the findall in the re module will create a list of all the matches.</p>

python regex