Regular Expression or Regex is basically a tool which we use to find pattern or find word, character or sentence in sequence of character. Here is the analogy:
You have been an overflowing inbox of emails and you want specific email to show up your criteria for it is:
- Find all emails with meeting.
- Find all emails with dollar amount.
- Spot all the emails which contains word like URGENT and IMPORTANT.
Now you can't open email one by one because it will take forever. So you decided setup a Smart Filter using rules like:
- If emails contains '$' sign then it must be finance show me.
- If emails have date or word like meeting show me.
- If subject contains ‘URGENT’ followed by ! marks, show me.
This exactly Regex do for NLP:
It acts like a smart filter for text — scanning through messy, unstructured language and pulling out what you’re interested in, based on patterns.
In coming lecture I will be explaining about regex.
Top comments (0)