Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Emacs, how to use align-regexp to align <- and = together

I've tried, with M-x align-regexp:

<-|=
(<-|=)
\(<-|=\)
\\(<-|=\\)

And the ones with <- and = reversed. But none work?

Example code as follows:

  (flags, params, errs) <- parseArgs <$> getArgs
  let options = foldr id [] flags -- Apply functions to list
like image 204
qrest Avatar asked Sep 12 '10 21:09

qrest


2 Answers

try \(<-\|=\) -- you need the (backslashed) parentheses, and you need to backslash the |

like image 115
jsegal Avatar answered Sep 24 '22 14:09

jsegal


You need to escape the |:

\(<-\|=\)
like image 27
scottfrazer Avatar answered Sep 24 '22 14:09

scottfrazer