QRegExp use find forward slash(/) and backward slash(\)
General and Desktop
4
Posts
3
Posters
5.6k
Views
1
Watching
-
-
the forward slash / has no special meaning in regular expressions.
@QRegExp rx("([a-zA-Z]:[\\/]|[\\/]{2})");@
works for both backward and forward slashes. (Note I've removed the whitespace character from the drive letter)But beware, you should also allow unix paths like "/home/dermanu", so possibly group "[a-zA-Z]:" together and make it optional by appending a "?" character