Comment and substring remover

Results 1 to 2 of 2

Thread: Comment and substring remover

  1. #1
    Join Date
    Dec 1969

    Default Comment and substring remover

    Hi,<BR>I&#039;m a beginner in regular expression, n I need a function that removes all substring between two comment.For example:<BR><BR>&#060;!--mycommstart--&#062;I need to remove this&#060;!--mycommend--&#062;<BR><BR>Please help me!<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Comment and substring remover

    *<BR>[NOT TESTED]<BR><BR>Set objRegExp = New RegExp<BR>objRegExp.Global = True<BR>objRegExp.IgnoreCase = True<BR>objRegExp.Pattern = "(&#060;!--mycommstart--&#062;)([sS]*?)(&#060;!--mycommend--&#062;)"<BR>newString = objRegExp.Replace(myString,"$1$3")<BR><BR>Where myString contains the comments.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts