BoDiE2003
BoDiE2003

Reputation: 1359

Match everything but not part of a url

I'm trying to make a regex to match any ending except ClaroArgentina So, this should not match: https://twitter.com/#!/ClaroArgentina But this should be a match: https://twitter.com/#!/asdasd

Im trying to make it work with this, but its not giving me results:

https\://twitter\.com/(^ClaroArgentina)

What im trying to archieve in that regex is to match on everything but not ClaroArgentina.

Upvotes: 0

Views: 202

Answers (2)

agent-j
agent-j

Reputation: 27913

You can use a negative lookahead in most languages.

http\://twitter\.com/#!/(?!ClaroArgentina)$

Upvotes: 1

benjer3
benjer3

Reputation: 657

Do you have to use just the RegEx? The simplest way would be to use String.EndsWith.

Upvotes: 0

Related Questions