Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2012
    Posts
    5

    Red face Unanswered: String Pattern Matching Progrom in Oracle using PL/SQL

    Hi everybody,
    Can anybody help me out with the pattern matching program in oracle using PL/SQL.
    Like, for example the input is : Assassins and the pattern is : ass, the output should be : 2 (i.e.,) it should show me the number of times the pattern is repeated. Try and please do reply me as soon as possible.

    Thank you.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    REGEXP_COUNT (if you are on 11g).

    I *think* that, reading through forums, I saw that Oracle Text is capable of doing that. I didn't use Oracle Text so I can't speak from my own experience, but Oracle Text CONTAINS Query Operators might be of use (DEFINESCORE, using OCCURRENCE(COUNT)).

    Pure PL/SQL? Write a program.

  3. #3
    Join Date
    Jan 2012
    Posts
    5
    hei,
    I was actually browsin thru the net whole of yesterday and got an answer which goes like this...
    select regexp_count('Assassins','ass',1) from dual;
    Output : 2
    the first parameter is the string passed, the next is the pattern to be found and the last parameter is the starting point from where you want the matching to be done...

  4. #4
    Join Date
    Jan 2012
    Posts
    5
    Thank you, LittleFoot.. Infact i didnt see your answer.. thanks a lot dude

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •