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

Re: [Clip] Regular oppression

Expand Messages
  • Mark B.
    ... Thank you, Wayne. That line appears to work. Obviously I m losing my marbles. ... Yes, thanks for the tip. You really helped me out. Mark Breault ...
    Message 1 of 8 , Dec 31, 1969
    • 0 Attachment
      >^!Replace "<sup>{\d*}</sup>" >> "<sup><a href=\"#n\1\">\1</a></sup>" IWSAR

      Thank you, Wayne. That line appears to work. Obviously I'm losing my marbles.

      >{\d+} is technically more correct.

      Yes, thanks for the tip. You really helped me out.

      Mark Breault



      -----------------------------------------------------
      Protect yourself from spam, use http://sneakemail.com
    • Mark B.
      Happy new millennium to everyone. I need to convert superscript numbers such as 3 to hyperlinks like this: 3 This
      Message 2 of 8 , Dec 31, 1969
      • 0 Attachment
        Happy new millennium to everyone.
        I need to convert superscript numbers such as

        <sup>3</sup>

        to hyperlinks like this:

        <sup><a href="#n3">3</a></sup>

        This Replace command works for one-digit numbers: ^!Replace "<sup>{\d}</sup>" >> "<sup><a href=\"#n\1\">\1</a></sup>" IWSAR. What regular expression would work with multi-digit numbers as well? {\d*} doesn't. I wonder how an expert handle this job.

        Thanks for your time and expertise.

        Mark Breault




        -----------------------------------------------------
        Protect yourself from spam, use http://sneakemail.com
      • Wayne VanWeerthuizen
        ... What you had, substituting the { d*}, looked correct to me, so I tested it on my system. I am running NoteTab Pro 4.83 under Windows 2000 SP 1. ^!Replace
        Message 3 of 8 , Dec 31, 2000
        • 0 Attachment
          On 31 Dec 2000, "Mark B." <k6c71x9bewxcs3001@...> wrote:

          >Happy new millennium to everyone.
          >
          >I need to convert superscript numbers such as
          >
          > <sup>3</sup>
          >
          >to hyperlinks like this:
          >
          > <sup><a href="#n3">3</a></sup>
          >
          >This Replace command works for one-digit numbers:
          > ^!Replace "<sup>{\d}</sup>" >> "<sup><a href=\"#n\1\">\1</a></sup>" IWSAR
          >
          >What regular expression would work with multi-digit numbers as well?
          >{\d*} doesn't. I wonder how an expert handle this job.

          What you had, substituting the {\d*}, looked correct to me, so I tested it
          on my system. I am running NoteTab Pro 4.83 under Windows 2000 SP 1.

          ^!Replace "<sup>{\d*}</sup>" >> "<sup><a href=\"#n\1\">\1</a></sup>" IWSAR

          Congratulations. Cause it works just fine.

          You may have merely made a typo when you were testing it earlier.

          Minor note:

          {\d+} is technically more correct. The difference being that {\d*} is
          able to match nothing (no digits at all.) {\d+} requires that at least
          one digit actually be present.

          To match ONLY numbers with 2 or more digits use: {\d\d+}.




          --
          Wayne M. VanWeerthuizen
          Homepage: http://landru.myhome.net/wayne
        • Wayne VanWeerthuizen
          ... By the way, this also works: ^!Replace { d+} 1 IWSAR That is, NoteTab does not seem to require quotes
          Message 4 of 8 , Dec 31, 2000
          • 0 Attachment
            On 31 Dec 2000, "Mark B." <k6c71x9bewxcs3001@...> wrote:

            >>^!Replace "<sup>{\d*}</sup>" >> "<sup><a href=\"#n\1\">\1</a></sup>" IWSAR
            >
            >Thank you, Wayne. That line appears to work. Obviously I'm losing my marbles.

            By the way, this also works:

            ^!Replace "<sup>{\d+}</sup>" >> "<sup><a href="#n\1">\1</a></sup>" IWSAR

            That is, NoteTab does not seem to require quotes inside the replace
            portion to be escaped, (meaning to precede them by a backslash.)

            But the escapes do not hurt it at all. They may make it easier, if in the
            future, you need to copy the expression into another programming language.


            --
            Wayne M. VanWeerthuizen
            Homepage: http://landru.myhome.net/wayne
          • Lotta
            Happy New Year to you all, I have two questions on day one. 1. Is there a direct way to check if a returned numeric value is an integer? Something nice like
            Message 5 of 8 , Jan 1, 2001
            • 0 Attachment
              Happy New Year to you all,

              I have two questions on day one.

              1. Is there a direct way to check if a returned numeric value is an
              integer? Something nice like IfInteger...?
              I've done some things with line numbers involving calculation and have
              forced an integer by specifying the decimal values to '0'. But if I really
              need to know if it is an integer or not - how?

              2. How do I make a Clip open a folder in the same way as if I double click
              on it with the mouse? Not the Explorer two window view, the My Computer One
              Directory at the Time view.

              Bye,
              Lotta
            • Jody
              Hi Lotta, ... NoteTab uses plain English for dummies like me... :) ... H=Try ^!Set %Data%=^$GetSelection$ ^!IfFalse ^$IsNumber(^%Data%)$ Skip ^!Info ^%Data% is
              Message 6 of 8 , Jan 1, 2001
              • 0 Attachment
                Hi Lotta,

                >1. Is there a direct way to check if a returned numeric value is
                >an integer? Something nice like IfInteger...?

                NoteTab uses plain English for dummies like me... :)

                >I've done some things with line numbers involving calculation and
                >have forced an integer by specifying the decimal values to '0'.
                >But if I really need to know if it is an integer or not - how?

                H=Try
                ^!Set %Data%=^$GetSelection$
                ^!IfFalse ^$IsNumber(^%Data%)$ Skip
                ^!Info ^%Data% is a number, or integer if you will. ;)
                ; However, like Wayne pointed out, if there is a "." in the figure,
                ; then it will not detect it as a number, but a mixed [up] case. <g>

                >2. How do I make a Clip open a folder in the same way as if I
                >double click on it with the mouse? Not the Explorer two window
                >view, the My Computer One Directory at the Time view.

                Here's a few from my sample Open Library

                H="Explorer"
                ^!Explorer /e

                H="Explorer C:\"
                ^!Explorer C:\


                H="Explorer C:\..."
                ^!Explorer ^?{=A:\|_C:\|D:\|E:\|^$GetDocumentPath$|C:\My Documents}

                For more info look in I think C:\Windows\Tips.txt One of those
                files has a number of examples of opening Explorer windows.
              • Lotta
                Hi, Sorry, I forgot to change the subject, my question has nothing to do with regular expressions. ... I did some searching to find the correct English word
                Message 7 of 8 , Jan 1, 2001
                • 0 Attachment
                  Hi,

                  Sorry, I forgot to change the subject, my question has nothing to do with
                  regular expressions.

                  >NoteTab uses plain English for dummies like me... :)
                  >
                  >^!IfFalse ^$IsNumber(^%Data%)$ Skip
                  >^!Info ^%Data% is a number, or integer if you will. ;)

                  I did some searching to find the correct English word :-). Seems like this
                  is a language problem again. Thought a 'number' could have decimals, so I
                  took it ^!IsNumber distinguished between numeric and alphabetical
                  characters. If number = integer it's exactly what I was looking for. Thanks.

                  > >2. How do I make a Clip open a folder in the same way as if
                  >
                  >H="Explorer C:\"
                  >^!Explorer C:\

                  I have forgotten how to make the red ears smilie. But I'm blushing.

                  >For more info look in I think C:\Windows\Tips.txt

                  Found that one some time ago. There is good stuff about keyboard short cuts
                  and DOS for the simple minded like me in Tips too. Bill ought to put all
                  those hidden little things in their own directory.

                  Thanks a lot,
                  Lotta
                • Jody
                  Hi Lotta, ... Methinks a lot of Americans forget they learned integer in early school because we normally say number except for say programmers and math
                  Message 8 of 8 , Jan 1, 2001
                  • 0 Attachment
                    Hi Lotta,

                    >>^!IfFalse ^$IsNumber(^%Data%)$ Skip
                    >>^!Info ^%Data% is a number, or integer if you will. ;)
                    >
                    >I did some searching to find the correct English word :-). Seems
                    >like this is a language problem again. Thought a 'number' could
                    >have decimals, so I took it ^!IsNumber distinguished between
                    >numeric and alphabetical characters. If number = integer it's
                    >exactly what I was looking for. Thanks.

                    Methinks a lot of Americans forget they learned "integer" in
                    early school because we normally say "number" except for say
                    programmers and "math people." You will find "integer" a few
                    places in Help like:

                    ^!If Integer1 <>= Integer2 GoToLabelTrue [ELSE GoToLabelFalse]

                    ^$IsNumber(number)$ will work on negative and positive natural
                    number, but as I stated it will not on say 19.95

                    H=IsWhat - Batter up! 2 balls, 1 strike, eaeaeah, swing batter, batter, batter, swing!!!
                    ^!Info ^$IsNumber(19.95)$^p^$IsAlphaNumeric(19.95)$^p^$IsMixedCase(19.95)$

                    >> >2. How do I make a Clip open a folder in the same way as if
                    >>
                    >>H="Explorer C:\"
                    >>^!Explorer C:\
                    >
                    >I have forgotten how to make the red ears smilie. But I'm blushing.

                    Don't you hate it when that happens! :) Yes, it was available in
                    version 2.63 and earlier versions. <vbg>

                    H=Grin
                    ^!CLIPBRD
                    ^!CharMap.exe
                    ^!Shell C:\WINDOWS\WINFILE.EXE
                    ^!Shell C:\WINDOWS\TIPS.TXT

                    >>For more info look in I think C:\Windows\Tips.txt
                    >
                    >Found that one some time ago. There is good stuff about keyboard
                    >short cuts and DOS for the simple minded like me in Tips too.
                    >Bill ought to put all those hidden little things in their own
                    >directory.

                    That would save a lot of users a lot of time if came up right
                    after install, but who reads that stuff anyway. :)

                    BTW, if you follow the batter through with the other pitches, I
                    predict he will walk to first base on the next two pitches. :-)

                    Check out the post from Wayne - really worth reading the whole
                    thing, but if not, skip to the chart and the Clip that made it.

                    [Clip] IsCapitalized and other Is Functions

                    Happy Clip'n!
                    Jody

                    http://www.notetab.net

                    Subscribe, UnSubscribe, Options
                    mailto:Ntb-Clips-Subscribe@...
                    mailto:Ntb-Clips-UnSubscribe@...
                    http://www.egroups.com/group/ntb-clips
                  Your message has been successfully submitted and would be delivered to recipients shortly.