w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Python Regex: Question mark (?) doesn't match in middle of string

Regex

d?

simply means that it should optionally (?) match single digit (d).

If you use something like this, it will work as you expect (match single digit anywhere in the string):

d




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.