2

i know that my question has been already asked many times, but even with those other topics, i still can't solve my issue...

So the question is : How can i just match this string : something.something without match anything like something.css something.jpg something.png etc... but this one have to match : something.cssblabla

What i have currently is something like that :

\w+.([^(css)|(png)|(jpg)]|\w+)

Thank you for help.

2 Answers 2

2

You could use boundary

\w+[.](?!(css|png|jpg)\b)\w+

boundary would check(not match) for any non word character(anything except \w).Hence the name word boundary

Sign up to request clarification or add additional context in comments.

Comments

2

You need to use negative lookahead:

\w+\.(?!css\b)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.