• Home
  • Jobs
  • Courses
  • Questions
  • Teachers
  • For business
  • ES/EN

0

28
Views
need to check following string formats are correct or not using regular expression

How can I check following string is in valid format or not? Can someone provide me regular expression to check this.

Expect format should be like :: key:valu;key2:value2;

Following are some valid and invalid strings I want to check.

k1:v1;k2:v2; => valid format
k1:v1;k2:v2 => valid format
somekey:value;k2:v2; => valid format
k1,v1;k2,v2 => invalid format
k1 v1; k2 v2; => invalid format

Thanks in advance.

about 1 month ago ·

Juan Pablo Isaza

1 answers
Answer question

0

This one fulfills your specs

([a-z0-9]+):([a-z0-9]+);([a-z0-9]+):([a-z0-9]+);? 

Have a try yourself https://regex101.com/r/gxjPhY/1

about 1 month ago · Juan Pablo Isaza Report
Answer question
Find remote jobs
Loading

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2022 PeakU Inc. All Rights Reserved.