A bit stumped in Regex Syntax

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    A bit stumped in Regex Syntax


    hello!

    I'm trying to use the POSIX regex syntax in PHP, and having a bit of
    trouble with word boundary separators.

    The basic syntax i have seen in the various tutorials i have read over the
    last bit all suggest some variation on \< and \> or :<: and :>:, etc. i
    have even seen code that uses:

    [[:<:]][:alnum:][[:>:]] to match a word containing alphanumeric
    characters.

    however, i cannot seem to get this to work at all. every time i enter:

    :<: in a regex, it does not match. if i enter [[:<:]], i get an error
    stating that there is an "mbregex compile err: invalid POSIX bracket type"
    in my file ...

    any ideas what's going on?

    thanks.

    [please do not suggest that i use the preg_ functions instead ... i need a
    multibyte character set (utf-8) compatible regular expression engine.]

    mark.



    --
    I am not an ANGRY man. Remove the rage from my email to reply.
  • John Dunlop

    #2
    Re: A bit stumped in Regex Syntax

    Mark wrote:
    [color=blue]
    > if i enter [[:<:]], i get an error
    > stating that there is an "mbregex compile err: invalid POSIX bracket type"
    > in my file ...[/color]

    So do I.
    [color=blue]
    > any ideas what's going on?[/color]



    --
    Jock

    Comment

    • John Dunlop

      #3
      Re: A bit stumped in Regex Syntax

      John Dunlop wrote:
      [color=blue]
      > Mark wrote:[/color]
      [color=blue][color=green]
      > > any ideas what's going on?[/color]
      >
      > http://bugs.php.net/bug.php?id=31576[/color]

      D'oh! Should've checked the email address of the person who
      submitted that bug report. It was you! We'll see how that
      goes.

      --
      Jock

      Comment

      • Mark

        #4
        Re: A bit stumped in Regex Syntax

        John Dunlop wrote:
        [color=blue]
        > John Dunlop wrote:
        >[color=green]
        >> Mark wrote:[/color]
        >[color=green][color=darkred]
        >> > any ideas what's going on?[/color]
        >>
        >> http://bugs.php.net/bug.php?id=31576[/color]
        >
        > D'oh! Should've checked the email address of the person who
        > submitted that bug report. It was you! We'll see how that
        > goes.
        >[/color]


        :-). i was feeling kinda stupid as i was working through the problem, but
        then tried it on my production (non-Windows :-)) machines and discovered
        that it worked teh awes0me!11!1!

        looks like it's only a problem on Winders WITH mbstring.dll enabled ...
        *sigh*. That might be the first time i've ever seen Windows be the lousier
        platform for intl support ... !!!

        thanks,
        mark.


        --
        I am not an ANGRY man. Remove the rage from my email to reply.

        Comment

        Working...