Conditionals in function strings?

Conditionals in function strings?

112
Power UserPower User
112

    Apr 19, 2006#1

    The ^{A^}^{B^} - matches expression A or B

    I can only get it to work in a Function string with literal A or B.

    Can the expression be used inside the ^( ^) tag?

    Secondly, can the expression be a generalised expression or only a literal?

    A worked example would be really helpful.

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

    6,686585
    Grand MasterGrand Master
    6,686585

      Apr 19, 2006#2

      Both questions: No!

      ^{A^}^{B^} is extremly limited. You cannot really use it with other regular expression conditions neither inside the brackets nor outside. For a really full featured OR you would need Perl compatible regular expression. Sorry!
      Best regards from an UC/UE/UES for Windows user from Austria

      112
      Power UserPower User
      112

        Apr 19, 2006#3

        Thanks Mofi.

        My experiments suggested this, but I was hoping I had missed something...

        Paolo

          Apr 19, 2006#4

          For those of you interested in conditionalisations in Function strings, I had a bit of a "lateral think" and came up with this (for C#):

          /Function String 3 = "%[ ^t]++[publicrvaten]+[ ^t]+^([clasenumrt]+[ ^t]+[a-zA-Z0-9_]+^)"

          If you look at the funny character ranges:
          [publicrvaten]+ will match: public private internal
          and
          [clasenumrt]+ will match: class struct enum

          This allows me to list classes, enums and structs in the functions list.

          Hope this helps someone...

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