T
T
Timokins2018-09-09 12:09:58
JavaScript
Timokins, 2018-09-09 12:09:58

How to exclude an expression with a dot using RegExp?

Good afternoon,
there are a number of lines:

/audio/
/audio/?page=4
/audio/name.id/
/video/
/video/?page=4
/video/name.id/

how to correctly compose RegExp so as not to include lines with a dot in the match, but include the first word, for example, audio, so that only these lines match
/audio/
/audio/?page=4

?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-09-09
@timokins

/^[^.]*audio[^.]*$/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question