-1

I am trying to write some regex to use in Eclipse file search that will find "http:", while allowing me to exclude a word or words before and after the "http:" Before making it work for both in front and behind, I am just trying to get it to work excluding phrases in the front using negative lookahead. So I have been trying this:

    ^(?!QName).*http:

or

    .*^(?!QName).*http:

I would expect this line to not come back in the search:

    // QName qn = new QName( "http://BUNDLE.wsdl","bundle");

But it does come back in the search. These both match the line all the way up to http: if QName is not present, or it matches the entire line if QName is present.

Eventually I want to make it more complex where I can exclude words in the front and back:

    ^(?!QName|xlmns).*http:^(?!word1|word2)

But I am far from that point - however any help on that will be appreciated since I am likely going to have trouble with it too

mkohanek
  • 69
  • 1
  • 10

1 Answers1

-1

Credit to Wiktor Stribiżew in the above post

    ^(?!.*(?:QName|xmlns).*http:).*http:
mkohanek
  • 69
  • 1
  • 10