Jump to content

idris

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

idris's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. first, thx for reply. So which one provides better performence ? It's always against the performance to use backtracking expressions ?
  2. Hi. It's me again. Question: is backtracking a good thing to do ? Do we always need to ignore backtracking ? Does it always reduce the performance ? Example: String: abcdefghi Regex #1 , .*i Regex #2 , .*?i First regex will go through a to i then backtrack one character and it's ok. Second regex will check if the next character is i every time it loops. So regex #1 needs 2 steps to be done while regex #2 needs 8. Or am I completely wrong ? So in this example, which one is better to use ? #1 or #2 ? Is backtracking completely BAD thing to do ?
  3. Thanks a lot.. Just learned something I didn't know.
  4. Since i am not a master in regular expressions but learner, better to ask, what is backtracking ? Cuz it works when i use a lazy quantifier in first subpattern :/ Please describe me backtracking in human-language
  5. Yes you are right. it's PREG_BACKTRACK_LIMIT_ERROR. But I didn't really understand you. There aren't 100.000 characters in this page ? Can you describe a bit more ? And how can i fix this pattern ? is it possible to fix ? Thanks.
  6. Sry I can't edit my topics. It isn't body it's message, you are right. But there is only one of <!-- message --> <!-- / message --> tags. Why do i need to care about greediness? Also there is only one of <title></title> tags. Are you sure its about greediness?
  7. here is the string $str=file_get_contents("http://www.skyscrapercity.com/showthread.php?t=1015089"); I'm trying to get title and message of this topic in one pattern. But instead of giving me any different regex, what is wrong in my regex? I became crazy cuz of this..
  8. This works: $pattern="#<title>(.*) - .*</title>.*<!-- body -->(.*)<!-- / body -->#si"; This doesn't work: $pattern="#<title>(.*) -.*</title>.*<!-- body -->(.*)<!-- / body -->#si"; The dot can't replace space ? Or is there any other problem ?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.