This is my first attempt to use regular expression for a sequence of string.. i am partially successful but wants to get things validated...
I have a sequence of character like
"ABC 34 DEX 456 NT 456 TEXT rt st NEWTEXT 4564"
All caps are identifier and subsequent is the value like the value of ABC is 34 and DEX is 456....
i need to replace the value of TEXT with *
1)it can be null
2)its name itself can change like TEXTVAL or TEXT:
3)there could be 2 or 3 space after TEXT
4)But the max length of value would be 5 and min would be 2
5)it can accept space too at any position in the value
Considering all above i reached in the conclusion that it would be hard to find number of element for Value..as space can be from value or from field...
what i have decided i will insert five stars(*****) max length of TEXT value...
so to achieve this i am using
Quote: Regex _regex = new Regex(@"/TEXT/([a-z0-9\-\ ]+)\ $");
for each field TEXT,TEXT: and TEXTVAL.. but i am not very much convinced with the approach ..can some body help me here..