/    Sign up×
Community /Pin to ProfileBookmark

how come pregmatch passes ???

I have the following pregmatch condition in my if condition:

[CODE]if (preg_match(“#^$listUri$#”, $uri)) {
// This condition passes
}[/CODE]

Let me lay out the values for both of the variables , so

[CODE]$listUri is actually this/is/the/.+/story/of/.+[/CODE]

and

[CODE]$uri is actually this/is/the/one/story/of/two[/CODE]

How come this pregmatch condition passes ?????

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogNov 26.2016 — In a regular expression, ".+" means one or more of [i]any[/i] character -- possibly not including newlines, depending on certain modifiers. ("." is any character, and "+" is the one-or-more repetition modifier.)
Copy linkTweet thisAlerts:
@gautamz07authorNov 27.2016 — @NogDog Thanks Got it bro ! ?
×

Success!

Help @gautamz07 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.18,
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,
)...