Copy codeCode: var trimInfo =
{Basic ://
// Simple blank character filtering in vb
, Classic: // \ s/
// Traditional JavaScript blank character filtering
, Ecmascript5:/[\ s \ xA0 \ u1680 \ u180E \ u2000-\ u200A \ u2028 \ u2029 \ u202F \ u205F \ u3000]/
// Supplementary definition of/s in ECMAScript 5
, Ex:/[\ s \ xA0 \ u2028 \ u2029]/
// The impression is related to the identifier or string in js. I forgot where the XD came from.
, Control:/[\ x00-\ x1F \ x7F-\ x9F]/
// Adds simple filtering of control characters
, DotNet:/[\ s \ xA0 \ u2000-\ u200B \ u3000 \ uFEFF]/
// Default implementation of the. NET platform
, Unicode:/[\ s \ x85 \ xA0 \ u1680 \ u180E \ u2000-\ u200A \ u2028 \ u2029 \ u202F \ u205F \ u3000]/
// Filter white spaces defined in the Unicode Standard
, Complex:/[\ x00-\ x20 \ x7F-\ xA0 \ u1680 \ u180E \ u2000-\ u200B \ u2028 \ u2029 \ u202F \ u205F \ u3000 \ uFEFF]/
// Composite filtering, which is the union of the above types
};
Note: The listed Code only uses the regular expression syntax to facilitate program processing, but it is not actually a regular expression that can be directly used for filtering.
Based on actual usage, you may need to add "g" or other signs, or further process them into more complex regular expressions.