Find and Replace any characters before a comma

I have LibreOffice 4.1 on my Mac OS X laptop. I am using spreadsheet and have a column that includes names formatted like this: first, last.

I would like to run find and replace so I can remove anything before and including the comma and space so I am just left with the last name. I used to do this in Excel and it worked well:

Find and Replace, select column, enter this in find "*, ", leave replace blank.

I cannot for the life of me figure out how to do this with regular expressions. Anyone know how I can do this?

  1. Edit | Find and Replace.
  2. Search for type in:
    ^.*, 

    Note: Last character is space.
  3. Leave “Replace with” input box empty.
  4. Click on “Other Options” and make sure “Regular expressions” is checked.
  5. Click Replace button (or Replace All it depends what you would like to do).

Detailed help for regular expressions used in LibreOffice: Regular Expressions - Old location of the ICU User Guide


In you case:

^ Match at the beginning of a line.

. Match any character.

* Match 0 or more times. Match as many times as possible.

, Comma and space not a special characters, but must be included in find & replace.

Just add dot to search string - ".*, " and check that Regular expresion is On

Or use Data-Text to column by comma and space