Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > reluctant quant...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 15949 of 16566
Post > Topic >>

reluctant quantifier doesn't work

by alex_us01 <arisalex@[EMAIL PROTECTED] > Apr 9, 2008 at 01:01 PM

Hi all,

I use an regex in Java 6 as this:
"<a .*?some string here</a>"

and expect that .*? will match the smallest char sequence.
However, it matches the longest.

I give this regex to a method I wrote:
	private Matcher getMatcherMLDA(String regex, String input) {
		Pattern pat = Pattern.compile(regex,Pattern.MULTILINE |
Pattern.DOTALL);
		Matcher matcher = pat.matcher(input);
		return matcher;
	}

It looks like the reluctant quantifier doesn't work.
thanks!
 




 9 Posts in Topic:
reluctant quantifier doesn't work
alex_us01 <arisalex@[E  2008-04-09 13:01:50 
Re: reluctant quantifier doesn't work
Roedy Green <see_websi  2008-04-09 21:37:14 
Re: reluctant quantifier doesn't work
Gordon Beaton <n.o.t@[  2008-04-10 05:59:19 
Re: reluctant quantifier doesn't work
Gordon Beaton <n.o.t@[  2008-04-10 05:58:40 
Re: reluctant quantifier doesn't work
Hendrik Maryns <gtw37b  2008-04-10 14:34:19 
Re: reluctant quantifier doesn't work
alex_us01 <arisalex@[E  2008-04-30 15:00:16 
Re: reluctant quantifier doesn't work
alex_us01 <arisalex@[E  2008-04-30 15:09:34 
Re: reluctant quantifier doesn't work
alex_us01 <arisalex@[E  2008-04-30 15:12:47 
Re: reluctant quantifier doesn't work
alex_us01 <arisalex@[E  2008-04-30 15:15:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 15:18:49 CST 2008.