i need to extract some data from a string using regular expression..
pattern is like this..
here is the string..
"weakened, 3rd of 7, 41l behind Steady Ed (11-12) at Limerick 2m 5f mdn hdl hvy in Nov."
i will have this kinda string and i want to extract the value which is with l , that is with the 41.. so i need to make some sort of Regular Expression which can extract the text with the l..
so can somebody help to make the regular expression..
Sheikhans
Member
47 Points
85 Posts
Need to match text from some string through Regular Expression..
Dec 09, 2012 04:39 PM|LINK
Hello.
i need to extract some data from a string using regular expression..
pattern is like this..
here is the string..
"weakened, 3rd of 7, 41l behind Steady Ed (11-12) at Limerick 2m 5f mdn hdl hvy in Nov."
i will have this kinda string and i want to extract the value which is with l , that is with the 41.. so i need to make some sort of Regular Expression which can extract the text with the l..
so can somebody help to make the regular expression..
Thanks for reading the message.
A
jimbenson001
Member
130 Points
35 Posts
Re: Need to match text from some string through Regular Expression..
Dec 09, 2012 05:07 PM|LINK
Is the "|" always going to be in the string, as a delimiter? If so, use the split method on the "|"
var x = yourstring.split("|");
This will give you an array of strings.. then you can take the first string
var TheValueYouWant = x[0];
Angie xu - M...
All-Star
20267 Points
1726 Posts
Microsoft
Re: Need to match text from some string through Regular Expression..
Dec 16, 2012 03:33 AM|LINK
Hi
You could use split like this, string [] split = words.Split("|");
and I think substring is also available for you.
Kind regards
Feedback to us
Develop and promote your apps in Windows Store