how preg_match any character except quote?

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

    how preg_match any character except quote?

    Hi all, please correct me if I'm completely off topic here... ;)

    I'd like to match any character except ". Been thinking about making a class [.!\"], but it does not work. It
    seems that dot [.] does not work in class. Is there a way to match any character in a class except some
    few characters? I know that making a class for all characters sounds alogical (that's maybe the reason
    why dot does not work), but I don't get any better solution.

    Thank you for help,
    Y.

    --
    sorry for any ads below :(

    Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
  • Jari Jokinen

    #2
    Re: how preg_match any character except quote?

    Yandos <fakemail@fakei sp.com> wrote:
    [color=blue]
    > I'd like to match any character except ".[/color]

    You can use negation (^) in a character class.

    [^"] matches any character except "

    --
    Jari

    Comment

    • Yandos

      #3
      Re: how preg_match any character except quote?

      "Jari Jokinen" <jari.jokinen@i ki.fi> wrote in news:JnSmg.8583 $Vq6.6794@reade r1.news.jippii. net:
      [color=blue]
      > Yandos <fakemail@fakei sp.com> wrote:
      >[color=green]
      >> I'd like to match any character except ".[/color]
      >
      > You can use negation (^) in a character class.
      >
      > [^"] matches any character except "
      >[/color]

      Thank you, it works :)

      Y.


      --
      sorry for any ads below :(

      Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php

      Comment

      Working...