[Solved] What will be the regular expression of the following in python?


Your question has very limited detail, however the very simple answer is:

^[+]{2,}$

However, that would only match the character “+” 2 or more times. Since you’re saying punctuation, it seems to imply that you want to allow other text. In that case, I would go with:

^[\w+ ]{2,}$

Which would allow all “word characters” and spaces. In the Python string, you will need to escape the backslash with another backslash.
If you want to experiment with regex strings, I would highly recommend the website http://regex101.com

EDIT: I have now seen your updated question, and to only have alphabetical characters and the plus symbol, you will want

^[A-Za-z+]{2,}$

1

solved What will be the regular expression of the following in python?