xml - RegEx to match a full string of various characters? -
i know question has been asked @ least 100 different times in @ least 100 different ways i'm struggling puzzle have found on create need.
i need regex can used inside xml pattern restriction tag matches these characters -
%&()"''*+,-./:;<=>?_#~@!$^[]{}0123456789abcdefghijklmnopqrstuvwxyz as 1 full string, not sigle words or characters. can include spaces, not tab spaces or return key characters.
this have far - [a-za-z0-9$-/:-?@#{-~!^_\'\[\] *]
thanks in advance,
ash.
[..] character set, , match single character given in set. if want match while string, need repetition * match zero or more , + match one or more. since want match entire string need anchor expression, can ^ start of string , $ end of string.
so following regex match star of string one or more characters given set end of string:
^[a-za-z0-9$-/:-?@#{-~!^_\'\[\] *]+$ if interested in learning regex might want read on basics there lots of sites tons of information, such this one.
Comments
Post a Comment