Skip to main content
added 325 characters in body
Source Link
select 1 from dual where regexp_like('%.,"''?!:#$&)(*;+-/<>=@[]\^_{}|~', '%\.,"''\?!:#\$&\)\(\*;\+-/<>=@\[\]\\\^_\{\}\|~'); 

This gives, as expeced, 1.

You must escape .?$)(*+[]\^{} and |

You do not need to escape , (but it works nonetheless):

select 1 from dual where regexp_like('%.,"''?!:#$&)(*;+-/<>=@[]\^_{}|~', '%\.\,"''\?!:#\$&\)\(\*;\+-/<>=@\[\]\\\^_\{\}\|~'); 

This works:

select 1 from dual where regexp_like('<div>Lets check for an <strong>inner</strong> tag :)</div>', '<(\w+)>[^<]*</\1>'); 

Gives 1. So does what you ask for:

select 1 from dual where regexp_like('<p>Lets get <i>this</i><div class="example">example going :)</div></p>', '><div class='); 

For which you don't even need regex, by the way.

EDIT: By guess is, that you are using a programming language to build your SQL. In that case, it is highly likely that you are not properly escaping your . If you want the SQL to include '\.' (an escaped .), you need to escape it for your lanuage too: '\\.' Likewise, if you want '\\\^' you'd need to write '\\\\\\^'

select 1 from dual where regexp_like('%.,"''?!:#$&)(*;+-/<>=@[]\^_{}|~', '%\.,"''\?!:#\$&\)\(\*;\+-/<>=@\[\]\\\^_\{\}\|~'); 

This gives, as expeced, 1.

You must escape .?$)(*+[]\^{} and |

You do not need to escape , (but it works nonetheless):

select 1 from dual where regexp_like('%.,"''?!:#$&)(*;+-/<>=@[]\^_{}|~', '%\.\,"''\?!:#\$&\)\(\*;\+-/<>=@\[\]\\\^_\{\}\|~'); 

This works:

select 1 from dual where regexp_like('<div>Lets check for an <strong>inner</strong> tag :)</div>', '<(\w+)>[^<]*</\1>'); 

Gives 1. So does what you ask for:

select 1 from dual where regexp_like('<p>Lets get <i>this</i><div class="example">example going :)</div></p>', '><div class='); 

For which you don't even need regex, by the way.

select 1 from dual where regexp_like('%.,"''?!:#$&)(*;+-/<>=@[]\^_{}|~', '%\.,"''\?!:#\$&\)\(\*;\+-/<>=@\[\]\\\^_\{\}\|~'); 

This gives, as expeced, 1.

You must escape .?$)(*+[]\^{} and |

You do not need to escape , (but it works nonetheless):

select 1 from dual where regexp_like('%.,"''?!:#$&)(*;+-/<>=@[]\^_{}|~', '%\.\,"''\?!:#\$&\)\(\*;\+-/<>=@\[\]\\\^_\{\}\|~'); 

This works:

select 1 from dual where regexp_like('<div>Lets check for an <strong>inner</strong> tag :)</div>', '<(\w+)>[^<]*</\1>'); 

Gives 1. So does what you ask for:

select 1 from dual where regexp_like('<p>Lets get <i>this</i><div class="example">example going :)</div></p>', '><div class='); 

For which you don't even need regex, by the way.

EDIT: By guess is, that you are using a programming language to build your SQL. In that case, it is highly likely that you are not properly escaping your . If you want the SQL to include '\.' (an escaped .), you need to escape it for your lanuage too: '\\.' Likewise, if you want '\\\^' you'd need to write '\\\\\\^'

Source Link

select 1 from dual where regexp_like('%.,"''?!:#$&)(*;+-/<>=@[]\^_{}|~', '%\.,"''\?!:#\$&\)\(\*;\+-/<>=@\[\]\\\^_\{\}\|~'); 

This gives, as expeced, 1.

You must escape .?$)(*+[]\^{} and |

You do not need to escape , (but it works nonetheless):

select 1 from dual where regexp_like('%.,"''?!:#$&)(*;+-/<>=@[]\^_{}|~', '%\.\,"''\?!:#\$&\)\(\*;\+-/<>=@\[\]\\\^_\{\}\|~'); 

This works:

select 1 from dual where regexp_like('<div>Lets check for an <strong>inner</strong> tag :)</div>', '<(\w+)>[^<]*</\1>'); 

Gives 1. So does what you ask for:

select 1 from dual where regexp_like('<p>Lets get <i>this</i><div class="example">example going :)</div></p>', '><div class='); 

For which you don't even need regex, by the way.