Reverse regex for a specific string
I'm still not quite sure what you are looking for, but if it is "find out whether the word" example "occurs on a line that does not start with any tabs", then here you go:
ruby-1.9.2-p136 :001 > samples = [ "very \n simple example of big", "very \n\t\t simple example of big" ]
=> ["very \n simple example of big", "very \n\t\t simple example of big"]
ruby-1.9.2-p136 :002 > samples.map{ |s| s[/^[^\t\n]+.+?example/] }
=> [" simple example", nil]
^(?!\t\t).*example
: http://rubular.com/r/DRdlscH6cO
^ ( \n, , ). . , .
:
^(?!\t\t)(.*)\bexample\b
, example, \t\t. \t \t\t .