- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to match nonword characters in Python using Regular Expression?nnnn
This code below matches all non-word characters from the given string and prints their list.
Example
import re s = 'ab5z8d*$&Y@' regx = re.compile('\W') result = regx.findall(s) print result
Output
This gives the output
['*', '$', '&', '@']
- Related Articles
- How to match nonword characters in Python using Regular Expression?
- Regular Expression re{ n} Metacharacter in Java
- Regular Expression re{ n, m} Metacharacter in Java
- How to match n number of occurrences of an expression using Java RegEx?
- Conversion to N*N tuple matrix in Python
- Matrix creation of n*n in Python
- Python program to print a checkboard pattern of n*n using numpy.
- Python program to print check board pattern of n*n using numpy
- Find (1^n + 2^n + 3^n + 4^n) mod 5 in C++
- Python – N sized substrings with K distinct characters
- Calculate n + nn + nnn + ? + n(m times) in Python
- Find value of (n^1 + n^2 + n^3 + n^4) mod 5 for given n in C++
- Python Program to calculate n+nm+nmm.......+n(m times).
- How to print a matrix of size n*n in spiral order using C#?
- Calculate n + nn + nnn + … + n(m times) in Python program
- How to rotate a matrix of size n*n to 90 degree using C#?

Advertisements