in reply to Re: regex: something...(!something)...something
in thread regex: something...(!something)...something

I've read that.. I understand I'm not a perl master, but if you know the solution, please, tell me where I'm not right..
$x = "<tr><td>1</td><td>2</td><td><font>3</font></td><td>4</td><tr>"; $x =~ s{<td>(?!<td>)3(?!</td>)</td>}{<td>($1)a($2)</td>}; print $x;
It does not work... are there any ideas?

Update

deep posts does not appear for some reasons.. I'll post again in the top-level:

you see, I met such problem not with html only... this is a general question. I'm pretty sure there must exist some regex to solve the problem, but my knowledge is too small. But, nevertheless, thanks)

Maybe, someone other knows any regex solutions?

Replies are listed 'Best First'.
Re^3: regex: something...(!something)...something
by toolic (Bishop) on Jul 17, 2008 at 17:48 UTC
    are there any ideas?
    Yes, consider abandoning a regex approach, and select an appropriate CPAN solution for parsing HTML. I have used HTML::TokeParser, although I am not experienced enough with it to know if it will solve your problem.
      you see, I met such problem not with html only... this is a general question. I'm pretty sure there must exist some regex to solve the problem, but my knowledge is too small. But, nevertheless, thanks)

      Maybe, someone other knows any regex solutions?
Re^3: regex: something...(!something)...something
by blazar (Canon) on Jul 18, 2008 at 22:27 UTC
    deep posts does not appear for some reasons.. I'll post again in the top-level:

    I personally believe you should go to your User Settings and avoid to "post again in the top-level" - that is not going to earn you anything. It's a matter of visualization anyway. Personally, I've set both Replies header depth and Replies text depth to 1000: but IIRC, with lower values you still get a pointer to deeper posts.

    --
    If you can't understand the incipit, then please check the IPB Campaign.