This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Oracle/OAS and the fly likes ORACLE Regular Expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "ORACLE Regular Expression " Watch "ORACLE Regular Expression " New topic
Author

ORACLE Regular Expression

Jigar M Gohil
Greenhorn

Joined: Dec 14, 2011
Posts: 25
I am trying to extract below pattern with ORACLE Regular Expression:

- start with & ( might also followed by # )
- ends with ;
- should not contain space
- should be from & amp; & lt; & gt; & quot;

I have build something as:



It only works for skipping one from above list ( amp, lt, gt, quot ).
Looking for a solution which works for skipping multiple words.

Thanks.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

What do you mean by "skipping"? It looks like you are trying to find matches. Or at least would be if you were querying a table other than dual.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jigar M Gohil
Greenhorn

Joined: Dec 14, 2011
Posts: 25
Jeanne Boyarsky wrote:What do you mean by "skipping"? It looks like you are trying to find matches. Or at least would be if you were querying a table other than dual.


Oops..Sorry my Bad...Correcting the requirement

- start with & ( might also be followed by # )
- ends with ;
- should not contain spaces
- should NOT be from & amp; & lt; & gt; & quot; (Please ignore the space after & in my post, its because the forum parses them even in the Code tag)

Thanks
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

You can click the checkbox next to "Disable HTML in this message" to avoid that problem in posting.

While what you are trying to do is clearer now, I'm not sure I fully understand. Can you post some examples? For example, maybe you expect the following to match
 
abc;<abc
&a;
{

But not
#a;
<<
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1035
    
  10

This looks to be a refinement of http://www.coderanch.com/t/621125/java/java/Regular-Expression-identifying-extracting-HTML where a fuller story is that the HTML is in a DB table and the OP only needs to match HTML entities .
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ORACLE Regular Expression
 
Similar Threads
Cannot Load Servlet from JSP
the value of <%@taglib uri="" %>?
retreaving the value in servlet which is set in session in a jsp page
parsing data and storing in the xml
Annotation in Validation