5

I can't figure out how to make textpad perform a regular expression that extends multiple lines.

I tried using perl syntax with /myregex/m with m as a modifier but that didnt' work. I can't see a checkbox or anything in the editor to tell it to do multiline.

anyone have any ideas?

Christopher Johnson
  • 2,629
  • 7
  • 39
  • 70

2 Answers2

0

It is entirely possible, and simple :) You just use \n

This search:

we\nwill

Matches the end of line 1 and the start of line 2 in this dummy text:

this is a test and we
will see if it matches
multiple lines.
LeonardChallis
  • 7,759
  • 6
  • 45
  • 76
0

Another way to do this is with [\s\S]. For example, if you wanted to find <option> tags in some HTML, you could search for:

<option[^>]*>[\s\S]*?</option>
Mr Lister
  • 45,515
  • 15
  • 108
  • 150
Derek Kurth
  • 1,771
  • 1
  • 19
  • 19