Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9061045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:23:15+00:00 2026-06-16T15:23:15+00:00

I have an input string of the format abc;def;ghi;jkl;…….. and so on. the smallest

  • 0

I have an input string of the format abc;def;ghi;jkl;........ and so on. the smallest allowed input string is abc, while there is no limit on max number of tokens. Also the length of each token is NOT fixed to 3. it can be any number of characters.

for eg, america;russia;uae is also an accepted input

I want to take out the first three tokens and make separate properties out of them. In case there are less than 3, then those respective tokens should be NULL.

So far I have tried a lot of regular expressions (which I am not comfortable with)

${testprop} contains the input string.

i am using the following command

propertyregex property="testprop1" input="${testprop}" regexp="(.*)(\;.*)*/" select="\1"

but it is not working. any suggestions for a better regex !!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T15:23:16+00:00Added an answer on June 16, 2026 at 3:23 pm

    Thanks everyone. I finally worked out the answer.

    Using the following regex,
    ([^;]+)([;]?[^;]*)([;]?)([;]?[^;]*)([;]?)

    we can get the first 3 string tokens in groups 1, 2 and 4 respectively. But the group 2 comes with a preceding ; which can be further removed by applying \;(.*) and extracting group 1.

    property name="inputString" value="russia;uae;germany;africa;"

    propertyregex property="string1" input="${inputString}" regexp="([^;]+)([;]?[^;]*)([;]?)([;]?[^;]*)([;]?)" select="\1"

    propertyregex property="string2" input="${inputString}" regexp="([^;]+)([;]?[^;]*)([;]?)([;]?[^;]*)([;]?)" select="\2"

    propertyregex property="string3" input="${string2}" regexp="\;(.*)" select="\1"

    propertyregex property="string4" input="${inputString}" regexp="([^;]+)([;]?[^;]*)([;]?)([;]?[^;]*)([;]?)" select="\4"

    This gives you the desired first three tokens in string1, string3 and string4

    string1 = russia

    string3 = uae

    string4 = germany

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have the following date as String format. Input 2010-04-20 05:34:58.0 Output I
The input string is '20100908041312' the format is year,month,day,Hours,minutes,seconds,time zone and I have ben
I'm working in Visual Studio 2008. I have a string input in the format
I have an input string in the format Jerry Lane(angle bracket)jerry.lane@gmail.com(bracket closed),Harry Potter(angle bracket)harry.potter@gmail.com(bracket
I have an input string in the following format: 12.34 When I call this
I have an input string that's generated as in following example: string.Format(Document {0}, was
I have an multiline input string of following format ID | Col1 | Col2
I have an input string. Format is below: This;is;my;long;string Any fast solution (a lot
I have an input string in the following format String input = 00IG356001110002005064007000000; Characters
I have an input string which data is coming in the following format: http://testing/site/name/lists/tasks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.