Enter your test strings: Testing '1c': Capturing \d+ only: 1='1', 2='', 3='' Capturing \d+ plus the letter: 1='1c', 2='', 3='' Testing '2w': Capturing \d+ only: 1='', 2='2', 3='' Capturing \d+ plus the letter: 1='', 2='2w', 3='' Testing '2c3w': Capturing \d+ only: 1='3', 2='3', 3='' Capturing \d+ plus the letter: 1='2c', 2='3w', 3='' Testing '1w1w': Capturing \d+ only: 1='1', 2='1', 3='' Capturing \d+ plus the letter: 1='', 2='1w', 3='' Testing '1w2r': Capturing \d+ only: 1='2', 2='2', 3='2' Capturing \d+ plus the letter: 1='', 2='1w', 3='2r' Testing '2r1c': Capturing \d+ only: 1='1', 2='', 3='2' Capturing \d+ plus the letter: 1='1c', 2='', 3='2r'