Want an 'e' followed by any number of other characters and then another 'e' : Meta characters « Regular Expressions Functions « Oracle PL/SQL Tutorial

Oracle PL/SQL Tutorial
1. Introduction
2. Query Select
3. Set
4. Insert Update Delete
5. Sequences
6. Table
7. Table Joins
8. View
9. Index
10. SQL Data Types
11. Character String Functions
12. Aggregate Functions
13. Date Timestamp Functions
14. Numerical Math Functions
15. Conversion Functions
16. Analytical Functions
17. Miscellaneous Functions
18. Regular Expressions Functions
19. Statistical Functions
20. Linear Regression Functions
21. PL SQL Data Types
22. PL SQL Statements
23. PL SQL Operators
24. PL SQL Programming
25. Cursor
26. Collections
27. Function Procedure Packages
28. Trigger
29. SQL PLUS Session Environment
30. System Tables Data Dictionary
31. System Packages
32. Object Oriented
33. XML
34. Large Objects
35. Transaction
36. User Privilege
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL/SQL Tutorial » Regular Expressions Functions » Meta characters 
18. 6. 16. Want an 'e' followed by any number of other characters and then another 'e'
SQL>
SQL> -- create demo table
SQL> create table myTable(
  2    id           NUMBER(2),
  3    value        VARCHAR(50)
  4  );

Table created.

SQL>
SQL> insert into myTable(id, value)values(1,'1234 4th St. Vancouver');

row created.

SQL> insert into myTable(id, value)values(2,'4 Maple Ct. New York');

row created.

SQL> insert into myTable(id, value)values(3,'4321 Green Blvd. London');

row created.

SQL> insert into myTable(id, value)values(4,'33 Third St. Toronto');

row created.

SQL> insert into myTable(id, value)values(5,'One First Drive. Queen');

row created.

SQL> insert into myTable(id, value)values(6,'1664 1/Springhill Ave');

row created.

SQL> insert into myTable(id, value)values(7,'66Fall Ave. Linken');

row created.

SQL>
SQL> select from mytable;

        ID VALUE
---------- --------------------------------------------------
         1 1234 4th St. Vancouver
         2 4 Maple Ct. New York
         3 4321 Green Blvd. London
         4 33 Third St. Toronto
         One First Drive. Queen
         6 1664 1/Springhill Ave
         7 665 Fall Ave. Linken

rows selected.

SQL>
SQL>
SQL> SELECT value,
  2      REGEXP_SUBSTR(value,'e.+e'),
  3      REGEXP_INSTR(value, 'e.+e') "@"
  4  FROM myTable;

VALUE        REGEXP_SUBSTR(VALUE,'E.+E')      @
1234 4th St. Vancouver       0         4 
Maple Ct. New York                               
e Ct. Ne       7
4321 Green Blvd. London       0
33 Third St. Toronto       0
One First Drive. Queen                             
e First Drive. Quee       3
1664 1/Springhill Ave       0
665 Fall Ave. Linken                               e. Linke
      12

rows selected.

SQL>
SQL>
SQL> drop table myTable;

Table dropped.

SQL>
SQL>
18. 6. Meta characters
18. 6. 1. Meta characters
18. 6. 2. The period may be substituted for any letter and still maintain a match
18. 6. 3. Use the caret-anchor to insist the matching start at the beginning of the string
18. 6. 4. Asking for a match for a capital 'F' followed by any character
18. 6. 5. The search string cannot be anchored at the beginning and then searched from some other position
18. 6. 6. Negating Carets
18. 6. 7. A '^' followed by something else like an 'l' (a lowercase 'L')
18. 6. 8. Match a string where 'i' is followed by any one character and followed by another 'i'
18. 6. 9. Regexp_Substr
18. 6. 10. '*' matches zero or more repetitions
18. 6. 11. '+' matches one or more repetitions
18. 6. 12. '?' matches exactly zero or one repetition
18. 6. 13. Asking to match an 'a' and zero or more 'b's:
18. 6. 14. A series of 'b's immediately following the 'a'
18. 6. 15. Matching at least one 'b'
18. 6. 16. Want an 'e' followed by any number of other characters and then another 'e'
18. 6. 17. REGEXP_SUBSTR(value,'e.*e')
18. 6. 18. Non-greedy '?'
18. 6. 19. Empty Strings and the ? Repetition Character
18. 6. 20. The '?' says to match zero or one time
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.