S
S
Shimpanze2018-05-28 09:56:20
Regular Expressions
Shimpanze, 2018-05-28 09:56:20

How to determine that this is not the beginning of a comment?

Hello!
I am writing my own code highlighting script. How do code editors determine that this ( library/*.js ) is not the beginning of a comment, but part of a URL?

/* Комментарий */
wp_enqueue_script('Name', get_template_URL() . '/library/*.js', false, '0.0.0', false);

I can't think of a suitable regular expression.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kalombyr, 2018-05-28
@Shimpanze

If in a line, then not a comment, i.e. if there is an open but not yet closed quote (' or "), then it is not a comment.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question