in reply to Regex problem

Well, the code you have there doesn't even compile (it's missing a semi colon). So, you didn't cut and paste it. What's your real code you have a problem with? (No, this is not an invitation to cut and paste a gazillion lines of code - write a short program that doesn't do what you expect it to do, test it, and cut and paste that).

If I add the semi colon, I *do* get the expected output. Giving

............ keyword=13 ............
as input produces
............ keyword=-13- ............
as output.

Perhaps your input doesn't contain what you expect it to contain.

Abigail

Replies are listed 'Best First'.
Re: Re: Regex problem
by Anonymous Monk on Jul 04, 2002 at 16:16 UTC

    Thanks Abigail & Kurt for saving my sanity.

    The missing semi-colon was a typo:(

    The problem, once I had stopped focusing on the regex was a line at the top of the loop that did

    next if m/keyword/;

    I some how deleted the ! from in front of the m//? It was there earlier....grrrr.

      just a sidenote: this additional check will not increase the performance of your script but actually slow it down.

      ---- kurt