The thing is that we are planning to do a migration from Oracle to Teradata and I'm trying to see the viability of migrating PL-SQL code to SAP BODS Scripting (to have the code independent from any database we use and avoiding a migration to Teradata Stored Procedure Language).
The example I am exposing is not an exact case I want to implement, but I need to get that functionality for stuff much more complex than that.
As I see that the SAP function "regex_replace" has "Capturing parentheses":
( ... ) | Capturing parentheses. Range of input that matched the parenthesized subexpression is available after the match. |
And the documentation says that "Range of input that matched the parenthesized subexpression is available after the match", I want to know how to invoke that piece of regular expression I've already "captured" with the "Capturing parentheses".
So then I could write something like:
- regex_replace($Word_In, '^([A-Z]+) ([A-Z]+) ([A-Z]+)$', '\2', null);
- # where $Word_In = 'HELLO COOL WORLD'
- # and '\2' means the second "captured" regular expression: ([A-Z]+)
And then obtain the content of the second expression in parenthesis: 'COOL'.
But '\2' doesn't work and I just want to know the sintaxis to get the second expression in parentheses in that case (and then extrapolate it to my real work).
Thanks and best regards