<p>This is a 3 part question regarding embedded RegEx into SQL statements. </p>

<ol>
<li><p>How do you embed a RegEx expression into an Oracle PL/SQL
select statement that will parse out
the “DELINQUENT” string in the text
string shown below?</p></li>
<li><p>What is the performance impact if used within a
mission critical business
transaction?</p></li>
<li><p>Since embedding regex
into SQL was introduced in Oracle
10g and SQL Server 2005, is it
considered a recommended practice?</p></li>
</ol>

<hr>

<p>Dear Larry :</p>

<p>Thank you for using ABC's alert service.</p>

<p>ABC has detected a change in the status of one of your products in the state of KS. Please review the
information below to determine if this status change was intended.</p>

<p>ENTITY NAME:      Oracle Systems, LLC</p>

<p>PREVIOUS STATUS:  --</p>

<p>CURRENT STATUS:   DELINQUENT</p>

<p>As a reminder, you may contact your the ABC Team for assistance in correcting any delinquencies or, if needed, reinstating
the service.  Alternatively, if the system does not intend to continue to engage this state, please notify ABC
so that we can discontinue our services.</p>

<p>Kind regards,</p>

<p>Service Team 1
ABC</p>

<p>--PLEASE DO NOT REPLY TO THIS EMAIL.  IT IS NOT A MONITORED EMAIL ACCOUNT.--</p>

<p>Notice:  ABC Corporation cannot independently verify the timeliness, accuracy, or completeness of the public information
maintained by the responsible government agency or other sources of data upon which these alerts are based.</p>

[{'answer_id': 73084, 'author': 'Matt Rogish', 'author_id': 2590, 'author_profile': 'https://Stackoverflow.com/users/2590', 'pm_score': 0, 'selected': False, 'text': '<p>Why not just use INSTR (for Oracle) or CHARINDEX (for SQL Server) combined with SUBSTRING? Seems a bit more straightforward (and portable, since it\'s supported in older versions).</p>\n\n<p><a href="http://www.techonthenet.com/oracle/functions/instr.php" rel="nofollow noreferrer">http://www.techonthenet.com/oracle/functions/instr.php</a> and <a href="http://www.adp-gmbh.ch/ora/sql/substr.html" rel="nofollow noreferrer">http://www.adp-gmbh.ch/ora/sql/substr.html</a></p>\n\n<p><a href="http://www.databasejournal.com/features/mssql/article.php/3071531" rel="nofollow noreferrer">http://www.databasejournal.com/features/mssql/article.php/3071531</a> and <a href="http://msdn.microsoft.com/en-us/library/ms187748.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms187748.aspx</a></p>\n'}, {'answer_id': 73336, 'author': 'Gary Russo', 'author_id': 3048, 'author_profile': 'https://Stackoverflow.com/users/3048', 'pm_score': 0, 'selected': False, 'text': "<p>INSTR and CHARINDEX are great alternative approaches but I'd like to explore the benefits of embedding Regex.</p>\n"}, {'answer_id': 74827, 'author': 'WIDBA', 'author_id': 10868, 'author_profile': 'https://Stackoverflow.com/users/10868', 'pm_score': 0, 'selected': False, 'text': '<p>In MS SQL you can use LIKE which has some "pattern matching" in it.  I would guess Oracle has something similar.  Its not Regex, but has some of the matching capabilities. (Note: its not particularly fast)..  Fulltext searching could also be an option (again MS SQL) (probably a much faster way in the context of a good sized database)</p>\n'}, {'answer_id': 78318, 'author': 'Sergey Stadnik', 'author_id': 10557, 'author_profile': 'https://Stackoverflow.com/users/10557', 'pm_score': 2, 'selected': True, 'text': '<p>Why would you need regular expressions here?\nINSTR and SUBSTR will do the job perfectly.</p>\n\n<p>But if you convinced you need Regex\'es you can use:</p>\n\n<p><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions129.htm#i1239887" rel="nofollow noreferrer">REGEXP_INSTR</a><br>\n<a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions130.htm#i1305521" rel="nofollow noreferrer">REGEXP_REPLACE</a><br>\n<a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions131.htm#i1239858" rel="nofollow noreferrer">REGEXP_SUBSTR</a>  </p>\n\n<p>(only available in Oracle 10g and up)</p>\n\n<pre><code>SELECT emp_id, text\n  FROM employee_comment\n WHERE REGEXP_LIKE(text,\'...-....\');\n</code></pre>\n'}, {'answer_id': 152118, 'author': 'Benjol', 'author_id': 11410, 'author_profile': 'https://Stackoverflow.com/users/11410', 'pm_score': 1, 'selected': False, 'text': '<p>If I recall correctly, it is possible to write a UDF in c#/vb for SQL Server. \nHere\'s a link, though possibly not the best: <a href="http://www.novicksoftware.com/coding-in-sql/Vol3/cis-v3-N13-dot-net-clr-in-sql-server.htm" rel="nofollow noreferrer">http://www.novicksoftware.com/coding-in-sql/Vol3/cis-v3-N13-dot-net-clr-in-sql-server.htm</a></p>\n'}]
['https://Stackoverflow.com/questions/73037', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3048/']