+ 1
User input for a regular expressions string
Can you use user input as a regular expression string. For example: words = r"spamspamspam" message = r input() if re. search(words, message): print("match") All Google results say to use 'raw_input()' but that's in Python 2 I want an easy way to test if there is ANY match whatsoever between a string and input. (So like testing a password for numbers and other symbols etc)
4 Respuestas
+ 4
u don't need re for it
https://code.sololearn.com/c6t9ht168ZKc/?ref=app
+ 4
it is simply
message =input()
0
Oma Falk Doesn't work here
https://code.sololearn.com/c97y7hjd6DUL/?ref=app
0
It's already a "raw" input.... try:
print(input())... now enter something like ....hello\n \" \' world.
It will output:- hello\n \" \' world......no escaping is done.