それがワイルドカードであることを正しく理解している場合w
(あなたが書いたものからはわからないため、あなたが提供する例により詳細がわかりません)、この正規表現は機能するはずです...
([1-9])(\1|w){2,}|w([1-9])(\3|w)+|ww([1-9])\5*
これはおそらく最もエレガントなソリューションではありませんが、機能するはずであり、次のような部分に分割されます...
# matches that don't start with wildcards
([1-9]) # get a digit, and capture for future reference
(\1|w){2,} # the captured digit, or the letter w, 2 or more times
| # or, matches that start with a single w
w # match a w
([1-9]) # get a digit, and capture for future reference
(\3|w)+ # get one or more of the captured digit, or letter w
| # or, matches starting with two w
ww # get two w
([1-9]) # get a digit, and capture for future reference
\5* # get all the successive captured digits
これもうまくいくはずです...
([1-9])(\1|w){2,}|w([0-9](\3|w)|w[0-9])