-1

I have Sample Text like these lines:

onmouseover="show(someText, some 1234, 'word')" height="60" onClick="do(1)"> 
onmouseover="show(someText, some 1234, 'word')"> 

I'm using java.util.regex.. My regex looks like this (unescaped):

(?<=over\=\"show\()(.*)(?=\)\")

I want to match only the characters between the braces but for the first line in sample text it matches everything until the last brace:

someText, some 1234, 'word')" height="60" onClick="do(1

I have read something about lazyness and possessive quantifiers and tried several approaches but I could'nt get it to work.

How do I have to design the suffix?

omnomnom
  • 190
  • 1
  • 12

1 Answers1

-1

here is the solution

(?<=over\=\"show\()(.*?)(?=\)\")

you have to put a ? behind your .* to make it fetch lazy (not eager)

Ivonet
  • 2,492
  • 2
  • 15
  • 28