0

whats the regular expression in python for any string without the char '/'. Thanks

2 Answers 2

8

No need for regular expressions

>>> s = 'asdf'
>>> '/' in s
False
>>> s = 'asd/asdf'
>>> '/' in s
True
Sign up to request clarification or add additional context in comments.

Comments

3

I don't know python's flavor of regex, but I can only imagine it would look something like this:

^[^/]*$

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.