Click here to Skip to main content
15,614,665 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello All,

I want to make a regular expression which will validate string of particular type.

The conditions to validate string are as follows:

- String should not contain characters like \ (backslash), / (forward slash), : (colon), * (asterisk), ? (question mark), " (double quotes), < (left angle bracket), > (right angle bracket), | (pipe)
- Do not contain a hyphen (-) or a period (.) as the first or last character of a string.

I tried a lot but not getting any success as I require single regular expression fulfilling all conditions.

1 solution

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900