Link to home
Start Free TrialLog in
Avatar of andieje
andieje

asked on

Basic regular expression

Hi

I need help removing some characters from an input string. When the input string is stored in sql server 2005 the characters appear as squares. What characters are these? I thought perhaps they were line breaks as there are 2 of these characters at the end of each line of text (by that i mean the 2 characters together encode a line break). Whatever they are i would like to remove them from my input and I don't know what regular expression i need to match them

many thanks
ASKER CERTIFIED SOLUTION
Avatar of crisco96
crisco96
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andieje
andieje

ASKER

thanks for yoru reply
why are you doing that in 2 separate replace calls?
I think I've heard somewhere that the way linux and windows handles carriage returns is different, like I think windows used \n\r, where linux just does \n, so just to be safe I replaced both separately with an empty string.
Avatar of kaufmed
You might want to copy the text into a text editor to verify that the boxes do indeed represent line breaks (most likely they are, but if they're not, you might as well know in advance).

Also,

    *nix: LF (\n)
    Windows: CR (\r) + LF (\n)
For the last post, the order is as posted for Win.:  \r\n
Avatar of andieje

ASKER

many thanks