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

need a regex to remove the Control characters in a string

Last post 10-30-2009, 10:51 AM by mash. 1 replies.
Sort Posts: Previous Next
  •  10-30-2009, 2:28 AM 57055

    need a regex to remove the Control characters in a string

    hi 

    im a new to regex.Please help me in solving this problem,

    I have a string which contains some special characters.(Control Characters) , While parsing the this string it causing some others problems.

    So, in need to remove these characters when they encounter

    For example, if the String is "TP£ºCF", i want o remove the special charcter and output should be "TPCF".

     

    Thanks

    Vijay 

     

     

     

  •  10-30-2009, 10:51 AM 57057 in reply to 57055

    Re: need a regex to remove the Control characters in a string

    vijay:

    hi 

    im a new to regex.Please help me in solving this problem,

    I have a string which contains some special characters.(Control Characters) , While parsing the this string it causing some others problems.

    So, in need to remove these characters when they encounter

    For example, if the String is "TP£ºCF", i want o remove the special charcter and output should be "TPCF".

     

    Thanks

    Vijay

     

    The characters you want to remove are not control characters. They may act as such to some device you are using but character-wise control characters are non-printable characters like <tab>, <linefeed>,<backspace>,<null>, <bell>.

    So a regex to remove those character wouldn't change your sample. So are you really trying to remove control character or are you trying to remove non-alpha characters? or non-alphanumeric characters?

    And as always please follow our Posting Guidelines as much as possible when asking a question


    Michael

    "In theory, theory and practice are the same. In practice, they are not."
    Albert Einstein
View as RSS news feed in XML