in reply to Re^9: regex to return line with name but not if it has a number
in thread regex to return line with name but not if it has a number
Maybe it helps you if you approach your problem in a different way.
From your data, it seems to me that the first field is always delimited by |. So maybe you should simply extract that first field and then worry about determining whether it's a person or a departement.
For example, the following regular expression will match everything up to the first bar:
/^(.*?)\|/;
Then you have the data in a far more manageable thing and can worry about determining whether it's a name or a departement.
|
|---|