on ‎2023 Apr 19 4:23 AM
Is it possible to look for a specific text and distinguish whether the matched text exists in a comment?
Something like this:
select 'really found' where 'select * from ABC;' like '%ABC%'; select 'found only in comments' where 'select * from mytable;--other table than ABC' like '%ABC%';this works, but I want to prevent this working:
select 'really found' where 'select * from mytable;--other table than ABC' like '%ABC%'; select 'found only in comments' where 'select * from ABC;' like '%ABC%';
Request clarification before answering.
have you checked the REGEXP search condition to solve the match inside a comment?
Eventually using
--.*?ABC.*?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.