/    Sign up×
Community /Pin to ProfileBookmark

Hey, I’ve been having trouble with not statements in regular expressions, the following is used to auto phrase hyperlinks:

“‘((http(s?)://)|(www.))([w.]+)([-~/w+.-?]+)’i”

However, if I have say:

[img=”http://sdfsf.com/image.png” link=”http://google.com”]Alt here[/img]

than the src of the image (and link) is parsed as a link (forming <a href …>), how can i change that regexp so that it does not do this?

I’ve been trying (guessing not statement) to not parse links if they match *=”*” with no result, any help much appreciated.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@andre4s_yNov 13.2008 — Add negative lookbehind assertion :
<i>
</i>(?&lt;![img=")

And i think you have bad pattern for match hyperlinks.
×

Success!

Help @Tabo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...