Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need to read a string value from the csv file.

Case1:
Tester:,UST1,

Read UST1
Case2:
Tester:,,

Read empty
Case3:
Tester:,UST1 UST2 UST3 ,

Read UST1 UST2 UST3

I used this regular expression (?<=Tester:,)(.*\s.*|\s*) but it reads comma(,) also
Posted

1 solution

How about selecting out everything that isn't a comma?

(?<=Tester:,)([^,]*)

You can enhance this to select out particular patterns too, just make sure that not comma is in each pattern
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900