Regular expressions must be greedy?

Created on 29 July 2009, almost 16 years ago
Updated 20 December 2024, 5 months ago

I'd like to get rid of some old server-side includes code in my nodes. So I want to use a search like this:

<!--.+?-->

There are some pages in which if I don't add that final "?" to make the search "lazy," I'll end up deleting real content that needs to stay in the page. But when I try to use this search in Regular Expressions mode, I get this error:



    * user warning: Got error 'repetition-operator operand invalid' from regexp query: SELECT t.body as content, t.nid, n.title FROM node_revisions t INNER JOIN node n ON t.vid = n.vid WHERE n.type = 'curriculum_page' AND t.body REGEXP '<!--.+?-->' in /usr/local/web/lamp/users/wsbe/site/sites/all/modules/scanner/scanner.module on line 801.
    * user warning: Got error 'repetition-operator operand invalid' from regexp query: SELECT t.body as content, t.nid, n.title FROM node_revisions t INNER JOIN node n ON t.vid = n.vid WHERE n.type = 'page' AND t.body REGEXP '<!--.+?-->' in /usr/local/web/lamp/users/wsbe/site/sites/all/modules/scanner/scanner.module on line 801.

No matches are found, though I get 64 returns if I leave out the "?" and let the regexp be greedy. Any suggestions?

πŸ’¬ Support request
Status

Closed: outdated

Version

1.0

Component

User interface

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    With D7 shutting down in a few weeks I'm triaging the D7 queue of scanner. Will leave bugs open for a bit longer and maybe, if the other committers want to, do a final D7 version release of scanner

Production build 0.71.5 2024