Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок+ 1
Please help me with the code
15 ответов
+ 2
define the problem first
+ 2
so keep looking for help. I am helping those who do what I say
+ 2
For only words try pattern: r'[a-zA-Z]+'
+ 2
Thank you so much for your help. it means a lot. :)
+ 1
I've a string which contains words , integers, special characters and floats. I want the output as only words , only integers, only floating points, only special characters and only words as separate outputs
+ 1
For only floats try pattern: r"-?\d+\.\d+"
+ 1
thank you. got one output.
+ 1
For only special caracters: r"[^\d\w]*"
+ 1
can we write our own pattern or everything is predefined?
+ 1
No it is not predefined. If you understand regular expressions you can create your own patterns.
+ 1
okay. I've to work on regular expression. and what is the difference between * and + in the pattern?
+ 1
can you suggest any source to learn regular expressions? like any books or websites?
0
the outputs are not proper. I've written the explanation inside the code.
0
* → matches zero or more;
+ → matches one or more;