Home » SQL & PL/SQL » SQL & PL/SQL » regular expression (merged)
regular expression (merged) [message #395179] Tue, 31 March 2009 10:06 Go to next message
vickey_sagar1
Messages: 77
Registered: August 2007
Location: pune
Member

Hi All,

I have column (column_e) which have data like is as

FY2006 Q1T-I Quarter
FY2006 Q2T-I Quarter
FY2006 Q3T-I Quarter	
FY2006 Q4T-I Quarter
FY2007 Q1T-I Quarter
FY2007 Q2T-I Quarter


Now i would like to search all rows in table where column_e value start with FY after four digit then one space then Q char after one number then T letter.


I have tried below but it is not working.could u please suggest the changes.

select * from dual where REGEXP_LIKE(trim('FY2006 Q1T-I Quarter'), '^FY[0-9]{4}[:space:]+Q[1-4]{1}T') ;

Thanks,
Sagar
Re: regular expression (merged) [message #395194 is a reply to message #395179] Tue, 31 March 2009 10:39 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select * from dual 
  2  where REGEXP_LIKE(trim('FY2006 Q1T-I Quarter'), '^FY[[:digit:]]{4}[[:space:]]Q[1-4]T');
D
-
X

1 row selected.

Regards
Michel

[Updated on: Tue, 31 March 2009 10:43]

Report message to a moderator

Re: regular expression (merged) [message #395374 is a reply to message #395194] Wed, 01 April 2009 04:36 Go to previous messageGo to next message
vickey_sagar1
Messages: 77
Registered: August 2007
Location: pune
Member

Thanks alot michel.
Re: regular expression (merged) [message #395383 is a reply to message #395374] Wed, 01 April 2009 04:58 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Or
select * from dual where REGEXP_LIKE(trim('FY2006 Q1T-I Quarter'), '^FY([0-9]){4}[ ]+Q([1-4]){1}T') ;
Previous Topic: Extract Data within the Parenthesis
Next Topic: Inconsistent Datatypes
Goto Forum:
  


Current Time: Sun Dec 04 08:33:26 CST 2016

Total time taken to generate the page: 0.07455 seconds