Tapatalk

Find optional group of characters

Find optional group of characters

5
NewbieNewbie
5

    Nov 10, 2005#1

    Hi I try to do the following.

    I would like to search for as string that looks like

    dateFormat or dateTimeFormat

    I tried the following, but the grouping of characters doesn't work.

    date(Time)*Format

    How do i specify to look for such a string.

    Regards

    Robert

    344
    MasterMaster
    344

      Nov 10, 2005#2

      Hi,

      try this:

      date[a-zA-Z_]*format

      Note: This is a UNIX-regexp style. Probably look for your search setting and change from UE to Unix.

      rds Bego :D
      Normally using all newest english version incl. each hotfix. Win 10 64 bit

      5
      NewbieNewbie
      5

        Nov 10, 2005#3

        Hi ,

        thanks for the quick response.
        I have tought about that too, but its not quite the same, don't you think so.

        i would like the regex to look for a string ( which means a defined order of characters ) and not a abitratry sequenz of allowed characters.

        any furhter ideas ?

        regards

        robert

        344
        MasterMaster
        344

          Nov 10, 2005#4

          Hmmm, don't really understand.

          search for (dateFormat|dateTimeFormat) and you'll get the first 4 of those 5:
          dateFormat
          dateTimeFormat
          dateFormatBlaBla
          dateTimeFormatBlaBla
          dateIamNotFoundFormat

          You need to say at least sth. like this (dateTimeFormat[ \n\r\f]|dateFormat[ \n\r\f])
          to eliminate line 3 and 4 too.

          Take those extensions to the beginning of the word to also eliminate words like
          "myPrefixDateTime"


          rds Bego
          Normally using all newest english version incl. each hotfix. Win 10 64 bit

          6,685587
          Grand MasterGrand Master
          6,685587

            Nov 10, 2005#5

            Yes, use with Unix regular expression (dateFormat|dateTimeFormat) and also check Match Whole Word Only and you should only find "dateFormat" or "dateTimeFormat".
            Best regards from an UC/UE/UES for Windows user from Austria

            344
            MasterMaster
            344

              Nov 10, 2005#6

              ÖÖÖööh, yes that works too. :idea:
              But it's almost TOO easy :wink:

              rds Bego
              Normally using all newest english version incl. each hotfix. Win 10 64 bit

              5
              NewbieNewbie
              5

                Nov 10, 2005#7

                hmm .. thanks ...
                so now to the advances section ;-) ....

                Actually i want to find the following strings to replace them:

                <dateTimeFormat pattern="dd.MM.yyyy" xml:lang="en-us"/>
                <dateFormat pattern="dd.MM.yyyy" xml:lang="en-us"/>
                <dateTimeFormat pattern="dd.MM.yyyy" />
                <dateFormat pattern="dd.MM.yyyy" />

                As i have read normally there is a possibility to define groups with (xy) and to add ?, + , * to repeat that phrase in ( ). How is this done in UltraEdit ? Is this part missing in UltraEdit.

                6,685587
                Grand MasterGrand Master
                6,685587

                  Nov 11, 2005#8

                  If you have the replace dialog open, there is a help button. Click on this button and you will get the help. Read it and follow the link to regular expression. Read it carefully, especially but not only the Unix section.

                  If you do not have success to find the correct expression by yourself, ask again here for help and also add an example how the 4 lines above should look like after the replace.
                  Best regards from an UC/UE/UES for Windows user from Austria

                  5
                  NewbieNewbie
                  5

                    Nov 11, 2005#9

                    Hi,

                    i have read the help and some helps on the internet and didn't have success.
                    the topic is about a regex, which finds all the above strings. the string konsist of groups which are optional. so normally i would expect a regex like this

                    <date(time)?format (pattern="[^"]*") (xml:lang="en-us")*\>

                    But as i mentioned i am missing the opportunity of ()? or ()*. I read that in unix notation this should be possible, but UltraEdit does't recognize the ().

                    6,685587
                    Grand MasterGrand Master
                    6,685587

                      Nov 11, 2005#10

                      You should read about Unix regular expression syntax of ULTRAEDIT and not a general Unix regular expression help! What I have wrote above?

                      UltraEdit's Unix regular expression implementation is not comparable to real Unix regular expression search feature. It is not as powerful as real Unix regular expression. It's just UltraEdit style regular expression with other characters according to Unix style.

                      The brackets for example are described in the help of UltraEdit as follows:

                      (expression)
                      Brackets or tags an expression to use in the replace command. A regular expression may have up to 9 tagged expressions, numbered according to their order in the regular expression.
                       
                      The corresponding replacement expression is \x, for x in the range 1-9.  Example: If (h.*o) (f.*s) matches "hello folks", \2 \1 would replace it with "folks hello".

                      In real Unix regexp a bracket is used for optional. But in UltraEdit as described it has a total different meaning and does not mean optional.
                      Now read the help of UltraEdit and think about it.
                      Best regards from an UC/UE/UES for Windows user from Austria

                      5
                      NewbieNewbie
                      5

                        Nov 11, 2005#11

                        Hi ,

                        thanks , ... i have read that an as i mentioned i did not find an alternative procedure to do something similar with ultraedit.

                        so my question is, is there a way that i haven't read about, that does the same .

                        regards

                        rob

                        344
                        MasterMaster
                        344

                          Nov 11, 2005#12

                          Hi rob,

                          still I don't really know where your problem is ....
                          put another find/replace example.

                          Why are you so keen on a string that repeats 0 to several times ?

                          is there a:
                          <dateTimeFormat pattern="dd.MM.yyyy" pattern="i dont know" xml:lang="en-us"/>
                          possible ?
                          Why does the match described before isn't good enough ?

                          rds Bego
                          Normally using all newest english version incl. each hotfix. Win 10 64 bit