Loading ...
Sorry, an error occurred while loading the content.

Regex

Expand Messages
  • abetsent
    Hi Sheri and other friends, You suggested to me: ^!Find (.*?) RIWS1 ^!Set %title77%=^$GetSelection$ This work well, however, I suppose that
    Message 1 of 2 , Nov 29, 2007
    • 0 Attachment
      Hi Sheri and other friends,

      You suggested to me:

      ^!Find "<title>(.*?)</title>" RIWS1
      ^!Set %title77%=^$GetSelection$

      This work well, however, I suppose that any time he search a <title>
      with inside multilines, he don't find. Or with one, two or three
      carriage returns. Also, the character ' apparently he ignore? I am not
      shure.

      I see the \r parameter, but I don't know how to include in the regex
      code, to ignore. If I want to ignore a specific character (let's
      say: ') how to do?

      How to fix?
    • Sheri
      ... dot only matches across multiple lines when you set the dotall option. You do that by including (?s) at the start of your pattern. Then dot matches all
      Message 2 of 2 , Nov 29, 2007
      • 0 Attachment
        abetsent wrote:
        > Hi Sheri and other friends,
        >
        > You suggested to me:
        >
        > ^!Find "<title>(.*?)</title>" RIWS1
        > ^!Set %title77%=^$GetSelection$
        >
        > This work well, however, I suppose that any time he search a <title>
        > with inside multilines, he don't find. Or with one, two or three
        > carriage returns. Also, the character ' apparently he ignore? I am not
        > shure.
        >
        > I see the \r parameter, but I don't know how to include in the regex
        > code, to ignore. If I want to ignore a specific character (let's
        > say: ') how to do?
        >
        > How to fix?
        >
        >
        dot only matches across multiple lines when you set the dotall option.
        You do that by including (?s) at the start of your pattern. Then dot
        matches all characters including linebreak characters.

        I don't know what you mean by ignore. Dot will normally match all
        characters except linebreak characters.

        If you wanted to match all characters except "a" you would use [^a]
        instead of dot. [^a] matches everything including linebreak characters,
        but not "a". [^ab] matches everything except "a" or "b". And so on.

        When you set your variable %title77% you should put the ^$GetSelection$
        in double quotes:

        ^!Set %title77%="^$GetSelection$"

        However as I said previously, you should first be checking whether the regex matched using ^!IfError.

        Regards,
        Sheri
      Your message has been successfully submitted and would be delivered to recipients shortly.