How can I parse a string to extract data using multiple user specified patterns in c# -
i have users want parse string , extract data. don't know content of string users know pattern each of strings , specify them using patterns.
e.g. data we're working metadata audio files album, artist, release date etc.
so each user may use separate string patterns denote format of strings:
user 1: user1-%album%-%releasedate%-directory.mp3 user 2: %artist%_directory_%genre%.aac
i need use above patterns (as example, pattern can vary each user) extract metadata string. if string is:
bonjovi_writer_rock.acc
i need extract metadata testing against pattern 1 not match , match against pattern 2 , artist bonjovi, genre rock , on , forth.
so restate:
- i have unknown string
- i have pattern specified user
is there simple way in c# extract metadata string using patterns , meta place holders specified in pattern match against string?
if problem broad, not solution - consider defining pattern users have use in sending feedback , use regex extract information. hope 1 helps
Comments
Post a Comment