Colin747
Colin747

Reputation: 5013

REGEX to match multiple conditions

I want to find // which is:

The rest of the string should be captured as well, regardless of whether or not the last two tokens are found later in the string.

I have tried:

//(?!span)|//(?!\\*)|(?<!\")//

Here is an example string that I want to find it in:

handle//Button(By.xpath("//*[@id='Page1']//span[safdsaf]"), hi);

Upvotes: 1

Views: 1621

Answers (1)

Andrew Clark
Andrew Clark

Reputation: 208475

I think something like the following should work:

(?<!")//(?!\*|span).*

Example: http://rubular.com/r/vXQWctfC3t

Upvotes: 2

Related Questions