Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Need help with creation of a validation pattern

KAREEM SHAIK July 12, 2023

Hello All,

Good day.

My name is Kareem. I need help with creating a validation pattern.

Following is my requirement:

The field value should be either of the following: 

"12/345/67890" or "3012034567890" or you can leave this field blank

Here the numbers can be anything in between 0 to 9.

Can anyone help me with the pattern?

Also, if I am not at the right place to ask the question, please guide me how and where to get the answer for the above question.

 

Thank you.

1 answer

Suggest an answer

Log in or Sign up to answer
1 vote
Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 12, 2023

Hi @KAREEM SHAIK 

Which product is this about please? Jira? And are you validating this with a plugin or some default functioanlity?

Here is a regex:

([0-9]*\/?)*

It matches any amount of numbers between 0-9 with optional forward slashes.

You were not very specific with the requirements but I hope it helps :-)

KAREEM SHAIK July 13, 2023

Thank you, Charlie.

I work with SAP Ariba tool. And we have a Tax meta data file which we import into the system. 

This particular tax validation pattern is for GERMANY tax code DE1 which is Germany: Tax number (Steuernummer). 

If you could help, then, I need the pattern which should allow the format as: "12/345/67890" or "3012034567890" or you can leave this field blank.

The validation pattern should allow the above mentioned formats (both) and also should allow the blank values.

Please let me know if you need further information.

Thanks again.

KAREEM SHAIK July 13, 2023

I forgot to mention the that pattern should restrict to the above format.

For example: 12/345/67890 should be exactly like this meaning before the first forward slash the pattern should allow only 2 numbers (any numbers from 0-9) and after the first forward slash it should only allow 3 numbers (any numbers from 0-9) and after the second forward slash it should only allow 5 numbers (any numbers from 0-9). 

Then, for the second format (3012034567890), the regex should only allow 13 numbers (any numbers from 0-9).

The regex pattern should also allow blank values meaning even if we do not populate the field for the GERMANY tax code DE1 the regex should allow this.

 

Thank you.

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 13, 2023

Hello!

Ok so this is not about any Atlassian tools? I suggest to use stackoverflow or other generic community forums in the future ;-)

For your regex, try this:

^([0-9]{2}\/[0-9]{3}\/[0-9]{5}$|^[0-9]{13}$|^$)
KAREEM SHAIK July 13, 2023

Thank you very much, Charlie. 

I will keep in mind to use Stackoverflow.

 

Thanks again.

TAGS
AUG Leaders

Atlassian Community Events