RegEx to reverse order of list?

Posted by quantomcat on Stack Overflow See other posts from Stack Overflow or by quantomcat
Published on 2010-05-30T18:18:13Z Indexed on 2010/05/30 18:22 UTC
Read the original article Hit count: 221

Filed under:
|
|
|
|

Is there a singular regular expression that can be used in, say, a text editor's search/replace dialog to reverse the order of the items in a list?

For instance, take this list:

  • First item
  • Second item
  • Third item

Select it in a text editor like EditPad, bring up the search and replace box, apply a regex (run as a loop or not) and turn it into:

  • Third item
  • Second item
  • First item

Can this be done?

© Stack Overflow or respective owner

Related posts about regex

Related posts about list