As the title shows, how do I capture a person who:
- Last name start with letter "S"
- First name NOT start with letter "S"
The expression should match the entire last name, not just the first letter, and first name should NOT be matched.
Input string is like the following:
- (Last name) (First name)
- Duncan, Jean
- Schmidt, Paul
- Sells, Simon
- Martin, Jane
- Smith, Peter
- Stephens, Sheila
This is my regular expression:
/([S].+)(?:, [^S])/
Here is the result I have got:
Schmidt, P Smith, P
the result included "," space & letter "P" which should be excluded.
The ideal match would be
Schmidt
Smith