-1

I need to find this pattern.

  ReadOnly = True
end

"ReadOnly = True" occurs 250 times across 190 files, so its going to take a while and I might miss some. Its space padded on the left and terminated with cr,lf.

I expect this to work, but it returns nothing. I have tried more complex expressions, but it seems to me that this should work.

ReadOnly = True\r\nend

I have tried engine modifier "s", but I suspect that Delphi has not implemented it.

Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41
  • 1
    Just to clarify - are you using a regex in the IDE to find this code or are you using Delphis TRegex? – Sebastian Proske Nov 14 '16 at 21:02
  • Sebastian, a good question. Its the grep search in the ide. Because I have gexperts installed, it may well have over-ridden the native Delphi's one. – Rohit Gupta Nov 14 '16 at 21:04
  • 1
    This is nothing to do with Delphi then. It's a gexperts question. Consider learning a scripting language so that such problems can be solved more easily. This is a minute's work for a moderately skilled Python programmer. – David Heffernan Nov 14 '16 at 21:34
  • Try just `ReadOnly = True\s+end` regex. – Wiktor Stribiżew Nov 14 '16 at 21:54
  • 3
    GExperts does not override the IDE's built in search functionality. You access GExperts Grep Search through the GExperts menu. – Ken White Nov 15 '16 at 01:08
  • If you are using the Delphi built search with regular expressions \r does not mean CR nor does \n mean new line (and in fact the help does not say that it does) As far as I can tell, the search is line by line and as such what you are trying to do is not possible. – Dsm Nov 15 '16 at 07:47

1 Answers1

0

Tested in Delphi 10.1 Berlin:

  readonly = true\nend
Andrei Galatyn
  • 3,322
  • 2
  • 24
  • 38