Sortases are bacterial enzymes that anchor surface proteins covalently to the peptidoglycan upon cleavage of a motif located at their C-terminal end. Motifs recognized by sortases of the class-B (SrtB) are defined by the consensus sequence NP(Q/K)(T/S)(N/G/S)(D/A). Evidence supporting this consensus is limited to IsdC of Staphylococcus aureus and Bacillus anthracis, cleaved at motifs NPQTN and NPKTG, respectively. In Listeria monocytogenes, StrB has two substrates, Lmo2185 and Lmo2186, containing NAKTN and NKVTN (or the overlapping sequence NPKSS) as putative sorting motifs. Some of these motifs do not match the consensus, because they lack either proline (P) at position 2 or glutamine/lysine (Q/K) at position 3. Here, we identified NPKSS as a sorting motif of Lmo2186 by monitoring anchoring to peptidoglycan of chimeras lacking each of its two predicted motifs. Motif-swapping experiments confirmed that NPKSS, but not NKVTN, could replace NAKTN for anchoring of an Lmo2185 chimera. Residue substitutions in the NPKSS sequence revealed the essentiality of proline at position 2 for recognition of this particular motif. Lysine at position 3 was however dispensable. Deletion of NAKTN, on the other hand, abrogated SrtB-mediated anchoring of the Lmo2185 chimera. NAKTN, therefore, represents an exception to the rule of a conserved proline in position 2 of the sorting motif. Taken together, our data indicate that proline is not absolutely required for substrate recognition by sortases of the class-B. In addition, they prove the capacity of a single sortase, as SrtB of L. monocytogenes, to recognize varied amino acids at position 2 of the sorting motif.