Regex to allow only one word followed by a url -


i doing this

std::string reg ="^/house/room/section/.*" 

this allows user pass word after section program picks , uses.however want user able put in 1 word not sentence after section. how can modify (.*) not have space in it. instance

/house/room/section/a1343         allowed /house/room/section/a1343 a1002   not allowed because space found inside follow word 

you use character class disallows spaces, so:

[^ ]* 

or specify non-whitespace characters:

\s* 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -