in reply to Regex Help!

The following two regexes transform the given names into the given outputs.
s/[^[:alpha:]]+Morrisville.*//; s/ *$//;

The first one removes Morrisville and the following together with any non-alphanumericbetic characters preceding it provided such characters exist. The second one removes the space at the end of the first name.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Regex Help!
by hdb (Monsignor) on Apr 18, 2013 at 07:36 UTC

    Why does it remove the standalone - but not the hyphen in Jones-Ingram?

      I beg your pardon? It removes the - because it is not alphabetic and is followed by the location. The hyphen in Jones-Ingram is not followed by the location.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

        Yes. Thank you. Now I understand. I was on a completely wrong track of thinking.