#40626 [NEW]: preg_match and koi8-r

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #40626 [NEW]: preg_match and koi8-r

    From: themixa at gmail dot com
    Operating system: Linux(PHP-5.1.6), Freebsd(PHP-4)
    PHP version: 4.4.5
    PHP Bug Type: PCRE related
    Bug description: preg_match and koi8-r

    Description:
    ------------
    preg_match don't recognize some letters in KOI8-R.

    Reproduce code:
    ---------------
    <?
    $result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R");
    if (!$result || preg_match('/koi8/i', setlocale(LC_CTYPE, 0)) == 0) {
    die("skip setlocale() failed\n");
    }
    #FRS is First russian letter
    #LRS is Last russian letter
    echo
    preg_match("/^[а-яА-Я]+$/","йцукенгшщзхъфывапролджэячсмитьбю");
    #patterrn with [frs-lrsFRS-LRS] and string contained full russian alphabet
    return 0
    echo
    preg_match("/^[а-яА-Я]+$/","абГДек");
    #patterrn with [frs-lrsFRS-LRS] and string some few russian letters
    (forexample, without third letter in alphabet) return 1

    ?>

    Expected result:
    ----------------
    First and second preg_match must return 1

    Actual result:
    --------------
    Only second preg_match must return 1

    --
    Edit bug report at [url]http://bugs.php.net/?id=40626&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40626&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40626&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40626&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40626&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40626&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40626&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40626&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40626&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40626&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40626&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40626&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40626&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40626&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40626&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40626&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40626&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40626&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40626&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40626&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40626&r=mysqlcfg[/url]
    themixa at gmail dot com Guest

  2. Similar Questions and Discussions

    1. trouble with preg_match()
      Can anyone tell me why the following evaluates to false preg_match("/^.*X$/",$composited_rod_end_head_p) when ...
    2. preg_match
      Hello, I would like to split a String containing ingredience with additional assigned footnotes... my problem I only get the first ingredience...
    3. preg_match allowing a-z AND å ä ö ü
      I've been searching the net and Google news groups for a preg_match expression that will return true on strings containing (uppercase and...
    4. preg_match bug
      Hey I wanted to see if anyone was getting the same problem. Using preg_match in the following pattern: "/<tr bgcolor="#FFFFFF">(.|\n)+?<\/tr>/" ...
    5. preg_match issue
      I have a function that checks the syntax of a string using preg_match. This function is used in a loop and always hangs on the same string (7 out of...
  3. #2

    Default #40626 [Opn->Fbk]: preg_match and koi8-r

    ID: 40626
    Updated by: [email]nlopess@php.net[/email]
    Reported By: themixa at gmail dot com
    -Status: Open
    +Status: Feedback
    Bug Type: PCRE related
    Operating System: Linux(PHP-5.1.6), Freebsd(PHP-4)
    PHP Version: 4.4.5
    New Comment:

    Please try using this CVS snapshot:

    [url]http://snaps.php.net/php4-STABLE-latest.tar.gz[/url]

    For Windows:

    [url]http://snaps.php.net/win32/php4-win32-STABLE-latest.zip[/url]




    Previous Comments:
    ------------------------------------------------------------------------

    [2007-02-25 07:24:22] themixa at gmail dot com

    Description:
    ------------
    preg_match don't recognize some letters in KOI8-R.

    Reproduce code:
    ---------------
    <?
    $result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R");
    if (!$result || preg_match('/koi8/i', setlocale(LC_CTYPE, 0)) == 0) {
    die("skip setlocale() failed\n");
    }
    #FRS is First russian letter
    #LRS is Last russian letter
    echo
    preg_match("/^[а-яА-Я]+$/","йцукенгшщзхъфывапролджэячсмитьбю");
    #patterrn with [frs-lrsFRS-LRS] and string contained full russian
    alphabet return 0
    echo
    preg_match("/^[а-яА-Я]+$/","абГДек");
    #patterrn with [frs-lrsFRS-LRS] and string some few russian letters
    (forexample, without third letter in alphabet) return 1

    ?>

    Expected result:
    ----------------
    First and second preg_match must return 1

    Actual result:
    --------------
    Only second preg_match must return 1


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40626&edit=1[/url]
    nlopess@php.net Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139