• There will be other code between square brackets in the text such as

    "Some code between markers [SQL:SELECT....] needs to stay."

    The above example executes some SQL.

    Its just the "[Comment:# ...]" sections I need to pull out.

    So :

    "Test text created [SQL:SELECT GetDate()] is here[COMMENT:#hello world]."

    becomes

    "Test text created [SQL:SELECT GetDate()] is here."