in reply to Re^3: Negating a regexp
in thread Negating a regexp
As I can no longer specify (more|less) as fixed patterns ( as per ikegami hunch ) Im again struggling to apply what is demonstrated to my actual data... Required output :#!/usr/bin/perl -w use strict; while ( <DATA> ) { s/ angle brackets between element pairs / instead make square +bracketed / print $_ . "\n"; } __DATA__ <sometag> my data here </sometag> <anothertag> further text </anothertag> <furthertag> not good as contains <this> in angle brackets </furtherta +g> <byetag> another possibility is <more> <than> one <angle pairs> in her +e </byetag>
<sometag> my data here </sometag> <anothertag> further text </anothertag> <furthertag> not good as contains [this] in angle brackets </furtherta +g> <byetag> another possibility is [more] [than] one [angle pairs] in her +e </byetag>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Negating a regexp
by GrandFather (Saint) on Feb 01, 2006 at 10:34 UTC | |
by jxh (Acolyte) on Feb 01, 2006 at 10:42 UTC | |
by GrandFather (Saint) on Feb 01, 2006 at 10:57 UTC | |
by jxh (Acolyte) on Feb 01, 2006 at 11:04 UTC | |
|
Re^5: Negating a regexp
by BrowserUk (Patriarch) on Feb 01, 2006 at 11:16 UTC | |
by jxh (Acolyte) on Feb 02, 2006 at 11:09 UTC |