In article <[EMAIL PROTECTED]> wrote "Eric Beaudoin" <[EMAIL PROTECTED]>:
> At 22:56 2002.02.15, Jim Witte wrote: >> What is the difference between \<p>[^x]*<li\ and \<p>[^a]*<li\ ? I was >cleaning up a >> webpage, trying to find paragraph tags followed by list-item tags (some of which >had a space >> inside the tag), with anything in between, and tried the first (forgetting off >hand the RegExp >> char for "any character"). There was a string " <p> \n <ul ><li " which the >second RegExp >> picked up, but the first one instead selected a range about 3000 chars long. >> >>Thanks, >>Jim Witte > > > m/<p>[^x]*<li/ matches a succesion of characters that bigins with "<p>", end with >"<li" and do not > have the "x" character between the "<p>" and the "<li". Keep in mind that that RegEx >are greedy. > They match as mush as they can. > > Maybe you were looking for something more like m/<p>[^x<]*<li/ ? (This one do not >matches if there > is a "<" character between the "<p>" and the "<li". > > Hope this helps. It seems strange that no 'x' or no 'a' is allowed between <p> and <li What is so special to that characters. I simple way to find <p> followed by <li is /\<p\>.*?\<li/s; if you don't want another tag between, forbid it: /\<p\> [^\<]*? \<li/xs Greetings, Andrea -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]