Quantcast
Channel: "or" in regex, how to find one value or the other - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by BoltClock for "or" in regex, how to find one value or the other

I believe you'll need to wrap video|image in its own subpattern:/\[(?:video|image)=([^\]]+)\]/iThe ?: designates it a non-capture group so your capture/backreference to ([^\]]+) is untouched.

View Article



"or" in regex, how to find one value or the other

How would you search for one value or another using regex:For example:[video= SOMETHING NOT IMPORTANT][image= SOMETHING NOT IMPORTANT]So either look for video or image:/\[video|image=([^\]]+)\]/iHow...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images