Special Characters

Hi,
we have the requirement to scrub the special characters like ",<,> . when i tried to implement this using pub.string:replace , i am not getting the expected result.

i entered Instring as "PICK PACK and HOLD. ORDER CANNOT SHIP UNTIL 9/27/07
i set the remaining parameters as follows

Search string → [",>,<]
replace string —>
useRegex-------> true

and the output in the pipe line is PICK PACK and HOLD. ORDER CANNOT SHIP UNTIL 9/27/07

i wondered why the second " is still exists in the output?. we are running on IS 6.5 with SP2 and Windows 2000

i appreciate if anyone guide me through the solution

Vasu

The " has special meaning in a regular expression. Review the wM docs for regex syntax. You also probably should not be using the , character in your search expression, unless you really mean to remove commas.

Are you doing this for XML? If so, this sort of search and replace is unnecessary.

Vasa,

I had the same problem with the special characters. Add this two characters ",” and you will get your output.
This would help if u are working with known characters.

Hi Reamon and Kerni,
Nice to see your responses. I have solved this issue. It is a data issue. Actually the second special character is not a Double Quotes. it is some unknown character. it looks like the same as " but actually not. i just removed that character and replace that one with " and executed the service. it works for me this time.

Is there any way of handling the unknown characters…? i am doing this for XML because instead of " some characters were coming in the XML.

when using the service documentToXMLString i have selected the

encode—>true
enforcelegalXML-----> true

Reamon-- is there any way otherthan this to populate the XML?
Please let me know your comments on this one

Vasu

Setting encode to true will “scrub” the XML properly. There is no need at the XML level to do a search and replace yourself separately. Your sample will become "PICK PACK and HOLD. ORDER CANNOT SHIP UNTIL 9/27/07” in the resulting XML.

Refer to http://www.w3.org/TR/html4/charset.html and http://www.w3.org/TR/html4/sgml/entities.html for information about character entity references.

I was mistaken about " being a special character in regex. It isn’t.