in reply to Regex grabs too much
was my first attempt, and grabbed way way way too much.$data =~ s/<.*?(\(~ .*? ~\)).*?>/$1/g
Came closer but still wouldn't have worked in the example I gave.$data =~ s/<.{1,10}(\(~ .*? ~\)).{1,10}>/$1/g
to be converted to just the variable, removing the form element around it, and for<input type="button" value="(~ something ~)">
to be left exactly as it is.<p> date: (~ something ~) </p>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Regex grabs too much
by lhoward (Vicar) on Jun 05, 2000 at 20:56 UTC | |
by raflach (Pilgrim) on Jun 05, 2000 at 21:02 UTC | |
by Anonymous Monk on Jun 05, 2000 at 21:45 UTC | |
by mikfire (Deacon) on Jun 05, 2000 at 21:41 UTC |