Inserting characters multiple times

Results 1 to 2 of 2

Thread: Inserting characters multiple times

  1. #1
    Join Date
    Dec 1969

    Default Inserting characters multiple times

    &nbsp;<BR>I am trying to come up with a RE that can search a string, and whenever it finds a comma without a space immediatley following (ex: word1,word2), would insert a space after the comma. Thus a string that looks like:<BR><BR>word1,word2,word3,word4<BR><BR>Would be converted to word1, word2, word3, word4.<BR><BR>I don&#039;t want to use the VBScript Replace() method b/c in case there are spaces after commas, I don&#039;t want to insert a new space there. For the pattern I already have "[,][a-zA-Z_0-9]", but I don&#039;t know how to replace the matches without over writing the character immediately after the comma; I want to insert a space instead.<BR><BR>Thanks in advance,<BR><BR>Chris

  2. #2
    Join Date
    Dec 1969

    Default RE: Inserting characters multiple times

    In this case you are dealing with the end of a word or a boundry.<BR><BR>objName.Pattern = "," <BR><BR>should do the trick.

Posting Permissions

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