Replace with RegExp

Results 1 to 2 of 2

Thread: Replace with RegExp

  1. #1
    Join Date
    Dec 1969

    Default Replace with RegExp

    Hello. Could some please take the time to assist me. I am trying to replace a string that has invaild characters according to my pattern. I want to exclude all character that are not either letters (A-Z) or digits (0-9) and a underscore but I am having trouble writing the pattern and the replace. I would appreciate any help. Thanks.<BR><BR>-Sanj

  2. #2
    Join Date
    Dec 1969

    Default RE: Replace with RegExp

    The w pattern matches all word characters, which happens to be the set [A-Za-z0-9_]. As with other patterns, the uppercase version (W) is the complement of that set. If you just want to replace invalid characters with nulls, this should work:<BR><BR>.Global = True<BR>.Pattern = "W"<BR>String = .Replace(String, "")

Posting Permissions

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