none
Replacing capturing group in between two numbers RRS feed

  • Question

  • Hi,

    I've been looking all over but I couldn't find a way to perform the following substitution in visual studio 2010 (vb.NET):

    input: "GU01
       215.202   229.851     0.000    0"

    pattern: "GU0([1234]\s[\s\d\.]*) 0.000"

    replacement: "GU0$16569.0"

    I want to have "GU01
       215.202   229.851    6569.0    0"

    What happens is that VB doesn't know if I'm refering to $1 (group number 1) or $16569 (group number 16569) on the replacement string. How do I solve that without using \b? I always end up with "GU0$16569.0" in place of the whole thing instead of having the group 1 read.

    Thanks!

    Bernardo


    Monday, February 4, 2013 9:40 PM

Answers