I am extending rouge
shell lexer for my jekyll
site and I want to do the following.
- Match
--word
. Captureword
, discard--
. - Match
<word>
. Captureword
, discard both<
and>
. - Match
word=anyNumber.word
. Captureword
andanyNumber.word
, discard=
.
First I have tried /(?=-+)\w/
, didn't match anything, then I tried to do reverse and discard word
such as /-+(?=\w*)/
, and it worked. What I am doing wrong?