Advertisement

Regular Expression Problem (perl)

Started by November 05, 2000 07:53 AM
0 comments, last by jumble 24 years, 2 months ago
OK, not game programming I know, but im having some trouble with this regexp in Perl. Basically what I want it to do is to substitute every ''a'' in a variable with a ''b''. Except that it should ignore all the ''a''s inbetween < and > (html tags). Here''s what i''ve already tried, but it makes some weird results!
    

$page =~  s/(\>.*?)(a)(.*\<?)/$1b$3/gi;

    
I''ve tried loads of different combinations, but nothing seems to work correctly! Any help appreciated, I''ve been trying for the past 2 days to get this working!
jumble-----------
Oh. Nevermind. I just got it working.
jumble-----------

This topic is closed to new replies.

Advertisement