Skip to content
Advertisement

search numbers with egrep and regular expression

Given a file file1 with this text:

JavaScript

I want to use egrep to search all the numbers that start with 5 and end with 1.

I have tried:

JavaScript

Advertisement

Answer

This regex will work

JavaScript

Regex Breakdown

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement