Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

need help for find and replace regular expression

Last post 07-02-2008, 4:42 PM by ddrudik. 1 replies.
Sort Posts: Previous Next
  •  07-02-2008, 2:58 PM 43698

    need help for find and replace regular expression

    hi,

     Input : 1,This,is,test,data,100,+66,22+12,567,..,+34
    Output: 1,This is test data,100,+66,22, +12,567,..,+34

    I'm trying to use the regular expression in C# to replace the above
    Input string to get the above given output string.

    Basically i'm trying to do the followings

    1. if any comma (,) is there between two alphabets that needs to be replaced with space charater
    2. if any "+" sign between two numeriec that needs to be replaced with ",+"

    I have used this expression [A-Za-z],[A-Za-z] to find the 1st scenerio but dont know
    what to use for the replace expression.

    I really appreciate your help on this.

    thanks in advance.

    I'm trying to use the regular expression in C# to replace the above
    Input string to get the above given output string.

    Basically i'm trying to do the followings

    1. if any comma (,) is there between two alphabets that needs to be replaced with space charater
    2. if any "+" sign between two numeriec that needs to be replaced with ",+"

    I have used this expression [A-Za-z],[A-Za-z] to find the 1st scenerio but dont know
    what to use for the replace expression.

    I really appreciate your help on this.

    thanks in advance.

    Filed under:
  •  07-02-2008, 4:42 PM 43701 in reply to 43698

    Re: need help for find and replace regular expression

    Raw Match Pattern:
    ([A-Za-z]),([A-Za-z])

    Raw Replace Pattern:
    $1 $2

    Raw Match Pattern:
    (\d)\+(\d)

    Raw Replace Pattern:
    $1,+$2


View as RSS news feed in XML