I need to match an arbitrary digit inside a negated set, but becasue sed
doesn’t support d
, I’m not sure how to do it.
<code>Works with PCRE, but not with sed:
^[^d]*d*
</code>
<code>Works with PCRE, but not with sed:
^[^d]*d*
</code>
Works with PCRE, but not with sed:
^[^d]*d*
Instead of d
, I can use [0-9]
or [[:digit:]]
, but how to include it inside a negated set?
<code>Doesn't work
^[^[0-9]]*[0-9]*
</code>
<code>Doesn't work
^[^[0-9]]*[0-9]*
</code>
Doesn't work
^[^[0-9]]*[0-9]*
<code>Doesn't work
^[^[[:digit:]]]*[0-9]*
</code>
<code>Doesn't work
^[^[[:digit:]]]*[0-9]*
</code>
Doesn't work
^[^[[:digit:]]]*[0-9]*
<code>Works, but ugly. I suppose there are better ways...
^[^0123456789]*[0-9]*
</code>
<code>Works, but ugly. I suppose there are better ways...
^[^0123456789]*[0-9]*
</code>
Works, but ugly. I suppose there are better ways...
^[^0123456789]*[0-9]*
1