Author Topic: regex with Multi-line search  (Read 5152 times)

rod_gomz

  • Community Member
  • Posts: 80
  • Hero Points: 1
regex with Multi-line search
« on: May 12, 2009, 04:09:36 pm »
If I have a procedure that spans two lines, can SE find them? Does SE support multiline regular expressions?

example:

Procedure
 aproc

I suppose the RE would be something like:

Procedure$ aproc

But SE won't match. Is it possible to do this in SE?

Rodrigo Gomez

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: regex with Multi-line search
« Reply #1 on: May 12, 2009, 05:29:58 pm »
Use \n instead of end of line anchor: Procedure\n aproc.  This will match the specified line ending for that particular buffer.

There is an option to turn off multi-line matching (\om) that allows the . (any character) to match any end-of-line characters, so you could use \omProcedure.*aproc, but matching the line-ending explicitly is more precise. 

rod_gomz

  • Community Member
  • Posts: 80
  • Hero Points: 1
Re: regex with Multi-line search
« Reply #2 on: May 12, 2009, 08:02:01 pm »
Thank you. That worked.