in reply to Search and Extract from String
Hi madbee,
There are several ways you can use to make this happen. Though following your "outline" could make it make ( I didn't try it), but using regex could also do this:
..produces...use warnings; use strict; while(<DATA>){ if(/controlled/i){ if(/(?<=a)\s(.+?)-?(?=controlled)/i){ #NOTE HERE print $1,$/; } } } __DATA__ This is a design-controlled string This is a design controlled string
NOTE: This might not be a generic solution, simply because am using OP data.design design
|
|---|