How to avoid this greedy match?
- From: news_howardz@xxxxxxxxx (News Howardz)
- Date: Mon, 28 Jan 2008 19:22:41 -0800 (PST)
Hi,
I have a trouble when composing a regex.
$str = "...<scirpt>xxx</script>zzz<script>yyy</script>..."
In the above string, "xxx" and "yyy", "zzz" stand for any substring other than "<script>"
I want to pick up "<script>yyy</script>", but each time I get the 2 script sections matched "<scirpt>xxx</script>zzz<script>yyy</script>".
I've tried the following regex:
1) "<script>.*</script>
2) "<script>.*?</script>
How can I avoid the this greedy match?
(I'm using ActivePerl 5.6.1)
Thanks,
Howardz
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
.
- Prev by Date: Re: How to match a token not be quoted?
- Next by Date: Re: How to avoid this greedy match?
- Previous by thread: How to match a token not be quoted?
- Next by thread: Re: How to avoid this greedy match?
- Index(es):
Relevant Pages
|
|