Try the following:
use strict; use warnings; while (<DATA>) { print "$_\n" for grep /\.xyz\.com$/, split; } __DATA__ AAA-BBB-CCC aaa-bbb-ccc-2345.xyz.com aa-dg-hj hira.xyz.com ddd-eee-fff-4567.xyz.com ddd-eee-fff vffg.xyz sunil.xyz.com mad.xyz.com
Output
aaa-bbb-ccc-2345.xyz.com hira.xyz.com ddd-eee-fff-4567.xyz.com sunil.xyz.com mad.xyz.com
In reply to Re: perl regex
by Kenosis
in thread perl regex
by sunil9009
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |