3 Replies Latest reply on Apr 18, 2011 6:44 PM by Udo

    split with only regex

    808319
      Hi Friends,


      I like to split "Some_Odd_2 yes first" into "Some_Odd_2", "yes" and "first". basically 1st part of string "Some_odd_2" will have a-zA-Z_0-9 and second will be "yes" or "no" and third will be "first" or "Last". please send me regex to split it.


      I need to with ant propertyregex which is similar to java regex but I can't call split just by split.


      Thanks in advance

      Edited by: 805316 on Apr 18, 2011 1:03 AM
        • 1. Re: split with only regex
          Udo
          Hi,

          I don't think you've hit the right forum for your question. Anyway your question seems to be too simple to be taken seriously. Obviously you can just split on the blank.
          There is a nice [url http://ant-contrib.sourceforge.net/tasks/tasks/propertyregex.html]reference for PropertyRegex. I assume the select expression is what you need. The regexp would simply be " ".

          -Udo
          1 person found this helpful
          • 2. Re: split with only regex
            808319
            hi, I have already seen this , Can you please tell me regex value in following for me

            <propertyregex property="pack.name"
            input="package.ABC.name"
            regexp="package\.([^\.]*)\.name"
            select="\1"
            casesensitive="false" />
            • 3. Re: split with only regex
              Udo
              Hi,

              it would work as follows for the first part
              <propertyregex property="pack.name"
              input="Some_Odd_2 yes first"
              regexp=" "
              select="\1"
              casesensitive="false" />
              Change the number in the select parameter to fit to the value you need.

              -Udo