how to parse out delimted variables from a string

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
tcl4p
Forum Newbie
Posts: 15
Joined: Mon Apr 02, 2007 9:28 am

how to parse out delimted variables from a string

Post by tcl4p »

Is there a way to use regular expressions to parse out delimited variables from a string? I have a project where the user has a description field defined as text in mysql. Inside the description field, which I can load from a query, there are delimited values such as %LastName%, %FirstName%, %Account% etc. However these variables are imbedded in sentences found in the description and therefore are not contiguous. I know I could use a loop to find the values, but wondered if there's some way to extract these values into a array.
Any help would be apprecitated.

Thanks,
Tom
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

tcl4p
Forum Newbie
Posts: 15
Joined: Mon Apr 02, 2007 9:28 am

Post by tcl4p »

feyd,
I wonder if you give me the matching pattern for the delimiters above "%String Value%". I've tried several different pattern, but no luck.

Thanks,
Tom
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

We've had many threads on the subject of matching the text between this and that. I'd rather not repeat what those threads have said.
Post Reply