asked on
ASKER
Oracle is an object-relational database management system. It supports a large number of languages and application development frameworks. Its primary languages are SQL, PL/SQL and Java, but it also includes support for C and C++. Oracle also has its own enterprise modules and application server software.
TRUSTED BY
REGEXP_REPLACE (io_message_body,
'(^|\W)<body>(\W|$)',
'\1' || LOWER ('<BODY>' || v_message_body) || '\2',
1, 0, 'i'
);
So, the search string is a start-of-line (^) or (|) non-word character (\W) [not: 0-9, A-Z, a-z, underscore], folllowed by <body>, and a non-word-character or end-of-line ($).
This is then replaced with: first group found (\1) [a group is a regexp in parens], that is the non-word character or start-of-line, then body tag is extended by some text, followed by the second group.
Or short: replace "<body>" with "<body>SomeMessageBody" by retaining a optional non-word character prefixing and/or suffixing the "<body>" tag, but that tag needs to stand on an own line.
I hope that was less confusing, but regexp aren't easy to understand ... A reference can be found at http://en.wikipedia.org/wiki/Regular_expression (and many other locations).