Author Topic: Search && line endings vs. statement endings  (Read 1571 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Search && line endings vs. statement endings
« on: July 25, 2018, 09:58:38 PM »
I wish Slick could treat each statement as a single line when searching.

When trying to search code that is heavily wrapped due to long lines, being able to reg-ex searching within a statement would be nice.

For ";" delimited code this is easy to approximate - just treat ";" as the line-end character, not \n.

For languages line Python its harder of course.

For example, say I have a statement like
Code: [Select]
print("testing", var1, var2)

To find cases where var2 is printed, I might search with the regex "print\(.*var2"
But it is wrapped
Code: [Select]
print("testing",
var1,
var2)

Then this regex won't find it.