Reputation: 4421
I try to remove JR. Jr jr.
with sed -i "s/(Jr\|JR\|jr)\.*//g"
but it doesn't work. Why and what should I do?
Upvotes: 0
Views: 18
Reputation: 185189
You have to backslash parenthesis too, so :
sed -i "s/\(Jr\|JR\|jr\)\.*//g"
or :
sed -i -r 's/(Jr|JR|jr)\.*//g'
or even better :
sed -i -r 's/jr\.*//ig'
Upvotes: 2