Pls Help!!!

V

vanita_tadake

Hi All,

I want to write conditional regular expression in Java/J2EE.

Any sample example will be preferrable. In Dot Net , conditional regex
are working properly but i want to do it in java/J2EE.

Like i have following regex in dot net which i want to write in java/
J2EE. :-

(([<]title).*(\bcontract(s)?\b|\border(s)?\b|\bsign(s|ed)?\b|
\bw[io]n(s)?\b).*(title[>]))(?=(?>(.|\n)*?([<]body).{1,1000}?(\b(re)?
new\b|\bpen(s)?\b).{1,100}?(\bdeal(s)?\b)))

Any help will be truely appriciated.

Thanks in advance.
 
A

Andreas Leitgeb

Hi All,
I want to write conditional regular expression in Java/J2EE.
Any sample example will be preferrable. In Dot Net , conditional regex
are working properly but i want to do it in java/J2EE.
Like i have following regex in dot net which i want to write in java/
J2EE. :-
(([<]title).*(\bcontract(s)?\b|\border(s)?\b|\bsign(s|ed)?\b|
\bw[io]n(s)?\b).*(title[>]))(?=(?>(.|\n)*?([<]body).{1,1000}?(\b(re)?
new\b|\bpen(s)?\b).{1,100}?(\bdeal(s)?\b)))

At first glance, I can't see anything that wouldn't also
work as a "Pattern" in java.

What's this "conditional" about?
See docu for java.util.regex.Pattern, on how to
get a boolean result (matches()? yes/no) from a
pattern and a string.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top