jQuery in Action, 2nd edition*
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


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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30586
    
154

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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30586
    
154

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: 1064
    
  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 .
 
GeeCON Prague 2014
 
subject: ORACLE Regular Expression