Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9035407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:45:07+00:00 2026-06-16T08:45:07+00:00

My following SQL is not working but when I use same regular expression in

  • 0

My following SQL is not working but when I use same regular expression in Java, it’s work fine

SELECT * FROM tbl WHERE REGEXP_LIKE
(MESSAGE, '^(92|0)?(3[0-9]{9})\\*([0-9]{4})\\*(([0-9]{3})|1000)$')

Please help what I am doing wrong.

i am comparing following string

03211234090*0000*75 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T08:45:08+00:00Added an answer on June 16, 2026 at 8:45 am

    There is a bug in your search pattern: \\*. This should be \*, as you only need one \ to escape the *.

    SELECT *
    FROM tbl
    WHERE REGEXP_LIKE(MESSAGE, '^(92|0)?(3[0-9]{9})\*([0-9]{4})\*(([0-9]{3})|1000)$')
    

    The other problem is in the \*(([0-9]{3})|1000)$ part – the last part of your string. The string you have provided 03211234090*0000*75 does not end with three digits between 0-9 or “1000”.

    $ means the string must end with the expression immediately preceding it.

    As a solution try putting \*(([0-9]{2, 3})|1000)$ if your business logic allows this. This will allow the either two or three digits or 1000 after the last asterisk to be accepted and the row will be retrieved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can not run following SQL from ant's sql task : BEGIN DBMS_AQADM.CREATE_QUEUE_TABLE( queue_table =>
In the following SQL statement, SQLite sorts correctly but MySQL does not: However, if
I have the following SQL query I was given, but I am not sure
I have the following SQL Server query: SELECT area FROM places WHERE REPLACE(area,'-',' ')
The following is not working and I am definitely missing the obvious but would
I am trying to convert the following SQL into NHibernate: SELECT * FROM dbo.Customer
I am trying to use Liquibase Oracle extensions from maven-liquibase-plugin but I'm not able
I have the following SQL query: select expr1, operator, expr2, count(*) as c from
I am running following query in SQL*Plus CREATE TABLE tbl_audit_trail ( id NUMBER(11) NOT
With the following Stored Procedure in SQL Server 2005 IF OBJECT_ID('[dbo].[UserProfile]') IS NOT NULL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.