Tag Archives: Regular Expression

Regular Expression RegEx Example for use in notepad ++ plus plus

For the generation of HTML-Doc out of the PLSQL-Sourcecode with PLDOC I had the problem to remove the trailing colon ‘:’ at the end of listing parameters.

Examplecode:

/**
*This is the comment about the functionality of this function,<br/>
* which is of cours incredible<br/>
*<br/>
*@param para_1:
* This is the long desription for parameter para_1…<br/>
* And this means:<br/>
* – everything is as fine<br/>
* – as it could be<br/>
*<br/>
*@param para_2:
* This is the long desription for parameter para_1…<br/>
* And this means:<br/>
* – everything is as fine<br/>
* – as it could be<br/>
*@return somethin beautiful
*/
FUNCTION set_something
( para_1 IN VARCHAR2
, para_2 IN NUMBER
)
RETURN NUMBER;

Solution:
The solution is inside the replace-gui to search for:
(.*\*.*@.*)(:)(.*)
and replace it with
$1$3

Explanation:
$1 represents the matched char inside the first pair of brackets.
All chars before the colon. (.*\*.*@.*)
$2 represents the matched char inside the first pair of brackets.
The colon itself. (:)
$3 represents the matched char inside the first pair of brackets.
All chars after the colon. (.*)
And so we replace it only with the first and the third part.
The second part ($2) means the colon itself we don’t care about or better we want to delete it…