How to grep on grep with regex? How to match only numbers and dots from a grep?
by debianfella from LinuxQuestions.org on (#6JCKA)
Code:curl -s https://packagist.org/packages/drupal/core | grep -oP '<span class="version-number">'.*Quote:
How to take only the 10.2.2 from this?
This command failed (no output is given):
Code:curl -s https://packagist.org/packages/drupal/core | grep -oP '<span class="version-number">'.* | grep -oP '^\d+(\.\d+)*$'How to grep on grep with regex? How to match only numbers and dots from a grep?
<span class="version-number">10.2.2</span> |
This command failed (no output is given):
Code:curl -s https://packagist.org/packages/drupal/core | grep -oP '<span class="version-number">'.* | grep -oP '^\d+(\.\d+)*$'How to grep on grep with regex? How to match only numbers and dots from a grep?