I want to create a regular expression for the following scenario:
If a string is a percentage character ( %
) then it can only be the following: % 20
, and can not be preceded by any other '%
'.
So if for example, then % 25
will be rejected. For example, the following string would be valid:
http://www.test.com/?&Name=My%20Name%20Is%20Vader
http://www.test.com/?&Name=My%20Name%20Is%20VadersAccountant%25
%% 25
Any help would be greatly appreciated,
Kyle
Edit:
In short, the scenario is that a link is written in an encoded state and then launched by Javascript. No decoding works, I tried Net decoding and JS decoding, each had the same result - the results remain encoded upon execution.
% is not required:
/ ^ [^% ] * (% 20 [^%] *) * $ /
No comments:
Post a Comment