Reputation: 2770
whats the regular expression in python for any string without the char '/'. Thanks
Upvotes: 0
Views: 212
Reputation: 360046
I don't know python's flavor of regex, but I can only imagine it would look something like this:
^[^/]*$
Upvotes: 3
Reputation: 20992
No need for regular expressions
>>> s = 'asdf' >>> '/' in s False >>> s = 'asd/asdf' >>> '/' in s True
Upvotes: 8