S
Steven
Hi everyone,
I am pretty much a newbie when it comes to using regular expressions.
I guess all the fancy syntax is pretty much confusing me all the time.
Can someone help me out with an example for the following.
I have the following strings in a file, more like a few hundred
"<record><na>Test Data Form</><t>W</><d></><ph"
1. From every line that I encounter, I want to extract the "Test Data
Form" from the string. Basically the value that lie inside the ">
<". How would I do that using Regex() ?
Also I have a second question. I ended up doing a search and replace
using notepad on the file, but after I was finished replacing what I
did not need in the file, I was left with. "Test Data Form,"
I ended up putting a comma on the last instances of the string
containing "</><t>" this value. That ended up leaving me with another
question with regex().
2. How would you scan lets say a few hundred strings in a file and
when you get to the "," or ", " you would delete everything from that
point onwards so you will only be left with what you need.
old string: "Test Data Form, xy1234"
new string: "Test Data Form"
Thanks for assisting me with this, it confuses me a lot.
Steven
I am pretty much a newbie when it comes to using regular expressions.
I guess all the fancy syntax is pretty much confusing me all the time.
Can someone help me out with an example for the following.
I have the following strings in a file, more like a few hundred
"<record><na>Test Data Form</><t>W</><d></><ph"
1. From every line that I encounter, I want to extract the "Test Data
Form" from the string. Basically the value that lie inside the ">
<". How would I do that using Regex() ?
Also I have a second question. I ended up doing a search and replace
using notepad on the file, but after I was finished replacing what I
did not need in the file, I was left with. "Test Data Form,"
I ended up putting a comma on the last instances of the string
containing "</><t>" this value. That ended up leaving me with another
question with regex().
2. How would you scan lets say a few hundred strings in a file and
when you get to the "," or ", " you would delete everything from that
point onwards so you will only be left with what you need.
old string: "Test Data Form, xy1234"
new string: "Test Data Form"
Thanks for assisting me with this, it confuses me a lot.
Steven