Regular expression to restrict Extended ASCII character set

前端 未结 3 1056
粉色の甜心
粉色の甜心 2021-01-23 16:09

I have multi lingual application which creates xml files but Extended ASCII characters from 168 to 254 (¿⌐¬½¼¡«»░▓│┤╡╢╖╕╣║╗╜╛┐└┴┬├) are not supposed in XML tags so, I would like

3条回答
  •  清酒与你
    2021-01-23 16:59

    Second option was to create a string of all symbols from 168 to 254 and check if string contains any of them but not sure if it is reliable and accurate solution.

    Yes, this is a reliable and accurate solution. It is also more lightweight than regular expressions.

提交回复
热议问题