Answer the question
In order to leave comments, you need to log in
What is the correct way to write a regular expression for "option"?
Hello. I can't make a regular expression for any command option. The regular is needed for the sublime theme. Actually, the option begins either with "-" or with "--". Initially, such a construction was written -{1,2}[\w-]+, but I did not take into account phrases with a dash. Then I decided to add \W at the beginning and everything would be fine, if you do not take into account that the option can be at the beginning of the line.
By the way, the theme turned out to be quite beautiful, who also thinks, I can throw off the source code.
UPD #1
Problem - unnecessary highlighting in "file-fafa"
Answer the question
In order to leave comments, you need to log in
what exactly is required?
I want to help, but I did not understand the essence of the task,
should I just select these options?
what if like this:
(-){1,2}([^\s])+
if options always come first in the line, but they can have spaces in front, put tabs (\s)* in front
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question