FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Regular Expression Help
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Regular Expression Help [message #179340 is a reply to message #179335] Mon, 08 October 2012 12:59 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Sun, 07 Oct 2012 21:20:21 -0700, Scott Johnson wrote:

> I have two possible values I need to match as the same.
>
> Name/11 (This one is pulled from the source DB)
> Name/11* (This is what I need to match to with or without the (*))

Hold on a cotton picking moment.

Why are you even trying to use regexp for this? Just because regex can
compare strings does not mean all string compares must be done with regex.

Could you not use a string compare?

if ( strncmp( $something_from_db, $something_to_match_against, $n ) === 0
) {
// strings match for first $n characters!
}

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to run a batch file using PHP?
Next Topic: dll load problem
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 22:57:48 GMT 2024

Total time taken to generate the page: 0.05389 seconds