Home » Mysql » Pattern Matching with Regular Expressions

Pattern Matching with Regular Expressions

Pattern Matching with Regular Expressions

Patterm Matching in MySQL : MySQL provide two type of patterm matching first one is usig WILDCARD and second type pattern matching is based on regular expressions using REGEXP operator.In this tutorials we will explain using regular expression.

Patterm Matching Using regular expression(REGEXP) :This type of pattern matching is used some special charecter for to get the required string from specified string.

To explain REGEXP pettern matvhing we are using our student table data structure which are priviously used in last tutorials

Pattern matching using REGEXP : REGEXP pattern matching is based on some special petern matching charecter set.

Following is the table of pattern, which is used along with REGEXP operator for pattern matching

Find the Record from students table where Father Name start with the substring ‘vi’ using REGEXP.

Result Image for this query

 

Find the Record from students table where Father Name end with the substring ‘th’ using REGEXP.

Result Image for this query

//Insert new record in table last example is without below record

Find the Record from students table where students Name have 'vikas' and 'kumar' both substring using REGEXP.

Result Image for this query

Find the Record from students table where students Name have 'vikas' and 'kumar' both substring using REGEXP.

Result Image for this query

Pattern Matching

, , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">