Brooks
Brooks

Reputation: 119

Search for string OR string

I'm trying to find <META content="http.*jpg OR content="http.*png using regex (.NET) in a block of text. So far I've tried the following without success:

<META content="http.*jpg|content="http.*png
<META content="http.*jpg | content="http.*png
(<META content="http.*jpg|content="http.*png)
(<META content="http.*jpg | content="http.*png)

If I only search for <META content="http.*jpg it finds it but if I use the bar | like in the examples above I get nothing.

Need some help please.

Upvotes: 0

Views: 22

Answers (1)

karthik manchala
karthik manchala

Reputation: 13640

You can use the following:

(<META content="http.*jpg)|(content="http.*png)

Explanation:

  • you have to specify regex which part to give preference on | operator.. which can be done by using paranthesis

Upvotes: 1

Related Questions