locked
vb 2012 use regex to substitute specific key words with specific replacements RRS feed

  • Question

  • I am creating a VB 2012 application in which I have a two-dimensional array containing a collection of specific (but case-insensitive) key words with their replacement words.  I also have a very large series of String variables which I read sequentially from a .CSV file.

    What I want to do is to efficiently parse each String variable searching for any occurrence(s) of the Key words held in the array and substituting with their replacement.

    I know I can use "standard" VB code to do this but my instinct tells me that using Regular Expressions might be far more efficient.

    Never having attempted to use Regular Expressions before, but having just spent several hours attempting to research the subject online, I know I need some help, please.

    Any advice or guidance will be gratefully received.

    Paul J

    Tuesday, January 20, 2015 4:39 PM

All replies

  • Hello,

    The 'Suggestions and Feedback for the Forums' forum is to give users a voice on Forums. Users can give suggestions for improvements or vote up suggestions and know that the Forums team is listening.

    I'd ask in the Visual Basic .Net Language forum on MSDN.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    • Proposed as answer by Mike Laughlin Wednesday, January 21, 2015 12:31 AM
    Tuesday, January 20, 2015 10:40 PM