change to lowercase not working

change to lowercase not working

33
Basic UserBasic User
33

    May 29, 2006#1

    Hi,

    VERSION ULTRAEDIT v12.10

    I want to replace all link in a whole website to lower case:

    For example:

    <a href="SSsD.DOC" ----> <a href "sssd.doc"

    I m using the new style regexp of ULTRAEDIT

    My regexep is:

    Code: Select all

    href="^(*^).^(*^)
    It would be replace by:

    Code: Select all

    href="\L^1.\L^2
    But it doesn't work and it don't understand the special character \L

    I have tried also:

    Code: Select all

    href="^1\L.^2\L
    Can you help me please? I'm a newbie.

    Regards

    6,605550
    Grand MasterGrand Master
    6,605550

      May 29, 2006#2

      Sorry, but in UltraEdit style you cannot do that. You have mixed UltraEdit style with Perl compatible regular expression style.

      Check at Configuration - Search - Regular Expression Engine if Perl compatible Regular Expressions is really enabled.

      Then use following:

      Find What: href="([^.]*).([^"]*)"
      Replace With: href="\L\1.\2\E"

      This will work (hopefully). It's also the first time I have used a Perl regex.
      Best regards from an UC/UE/UES for Windows user from Austria

      33
      Basic UserBasic User
      33

        May 29, 2006#3

        So please what is the solution in UltraEdit style or Unix one?
        Because I never use Perl style because I don't know it.

        At Configuration - Search - Regular Expression Engine there's 3 modes:
        1-Using the new regex UltraEdit style
        2-regex UltraEdit style
        3-regex Unix style

        6,605550
        Grand MasterGrand Master
        6,605550

          May 29, 2006#4

          An automatic conversion to lowercase with a replace is only possible with Perl regex. The UltraEdit and the legacy Unix style are limited in their capabilities.

          For details about UltraEdit/Unix regular expressions see in help of UE the topics "Find command" and "Regular Expressions". If you read these 2 help articles, you will not read anything about "convert to lowercase" because it is simply not possible.

          In UltraEdit style only following macro can be used. But this macro can be executed only on the current file where as the Perl regex can be used also with Replace In Files.

          InsertMode
          ColumnModeOff
          HexOff
          UnixReOff
          Top
          Loop
          Find RegExp "href="*""
          IfFound
          ToLower
          Else
          ExitLoop
          EndIf
          EndLoop

          For the Perl regex engine you have to check the option at top of the Regular Expression Engine configuration dialog.
          Best regards from an UC/UE/UES for Windows user from Austria

          12
          Basic UserBasic User
          12

            Jun 18, 2006#5

            and my lowercase all :D

            Code: Select all

            InsertMode
            ColumnModeOff
            HexOff
            UnixReOff
            Top
            Loop 
            Find RegExp "%[A-Z]*^p"
            IfFound
            ToLower
            Else
            ExitLoop
            EndIf
            EndLoop
            exist something simplify?

            112
            Power UserPower User
            112

              Jun 19, 2006#6

              Mofi wrote:Find What: href="([^.]*).([^"]*)"
              Replace With: href="\L\1.\2\E".
              Hi Mofi (or anyone),

              Can you tell me why \L ([^[:lower:]] - that is NOT lower) works and \l ([[:lower:]]) doesn't?

              I had a similar problem to this one and I tried \l which didn't work! Then I remembered this posting and checked it out. \L works fine, but I don't really understand why... Like you, this is my first Perl RegEx (although I've used other RegExs before).

              Also, I couldn't find \E in the help or the Boost site - what does it mean?

              TIA,
              Paolo
              There is no such thing as an inconsistently correct system...
              Therefore, aim for consistency; in the expectation of reaching correctness!

              6,605550
              Grand MasterGrand Master
              6,605550

                Jun 19, 2006#7

                Hi Paolo!

                Look at Regular Expressions Reference. There you can read about the difference of \l and \L and what \E means.
                Best regards from an UC/UE/UES for Windows user from Austria

                112
                Power UserPower User
                112

                  Jun 19, 2006#8

                  Thanks Mofi,

                  That means that there are two definitions for \L depending on context?

                  Does the UE Help file need updating?

                  Paolo
                  There is no such thing as an inconsistently correct system...
                  Therefore, aim for consistency; in the expectation of reaching correctness!