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

Multilayer CSV to filtered excel -

Listboxes in c# -

ios - Why must I define variables twice in the Header file? -