dkchinnari Posted July 31, 2014 Report Posted July 31, 2014 he worked ahrd man.. r u srs..efudu ikade thagaldthadu
Spartan Posted July 31, 2014 Report Posted July 31, 2014 r u srs..efudu ikade thagaldthadu adi manam..
bevarse Posted July 31, 2014 Author Report Posted July 31, 2014 to understand regex... read this http://www.regular-expressions.info/refquick.html C# lo You don't need a regex for URLs, use System.Uri class for this. E.g. by using Uri.IsWellFormedUriString method for this: bool isUri = Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute); source : http://stackoverflow.com/questions/5717312/regular-expression-for-url yemo bhayya ee regex yeppudu ardam avvadu
k2s Posted July 31, 2014 Report Posted July 31, 2014 yemo bhayya ee regex yeppudu ardam avvadu sadava kunda ardam kadu antey etta man first saduvu
puli_keka Posted July 31, 2014 Report Posted July 31, 2014 bhayya, naa ku oka text file ichharu. It has bunch of url's and some other data. I want just the url's from that file. Ex: "http://blog.illumen.org/ways/?p=89917 crawl-frequently unchanged 0 0 0 1 0 0 2014/07/31 06:32 text/html 6614 91d875d71a9942 182 5" deenilo nunchi I should be able to extract only http://blog.illumen.org/ways/?p=89917 any ideas?? bujja endhi ee formatting? asalu emi artham avvatle nee string .. find a url in string regex ani kodithe kuppalu vasthayi man. simple ga ee regex enough http:\/\/[\s\S]+?(?=\s)
macha Posted July 31, 2014 Report Posted July 31, 2014 explain if the URL contains special char like" _-+=!@ # $ % ^ & * " it will not validate ani saying mama... @ts C# lo edi... nee regualr expression nee iekadaa validate chesukoo http://www.regexr.com/ you can build and test also (http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?
k2s Posted July 31, 2014 Report Posted July 31, 2014 if the URL contains special char like" _-+=!@ # $ % ^ & * " it will not validate ani saying mama... @ts C# lo edi... nee regualr expression nee iekadaa validate chesukoo http://www.regexr.com/ you can build and test also (http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])? \ pettanu kada to consider special as a literal
macha Posted July 31, 2014 Report Posted July 31, 2014 \ pettanu kada to consider special as a literal my bad .... you rock I say...
bevarse Posted July 31, 2014 Author Report Posted July 31, 2014 bujja endhi ee formatting? asalu emi artham avvatle nee string .. find a url in string regex ani kodithe kuppalu vasthayi man. simple ga ee regex enough http:\/\/[\s\S]+?(?=\s) ayya meeru devudu ayya. Google cheyyadam nerpinchav final ga code ila raasanu and adi work ayyindi String replacedata = File.ReadAllText(@"C:\Users\Desktop1\Desktop\Replace\Replace.txt"); foreach (Match m in linkParser.Matches(replacedata)) Console.WriteLine(m.Value); Console.ReadLine();
bevarse Posted July 31, 2014 Author Report Posted July 31, 2014 sadava kunda ardam kadu antey etta man first saduvu help ki chala thanks bhayya but ippatiki ippudu chadivi adi ardam chesukoni implement cheyyadam kanna meelanti intelligent fellows ni adagadam easy ani
puli_keka Posted July 31, 2014 Report Posted July 31, 2014 ayya meeru devudu ayya. Google cheyyadam nerpinchav final ga code ila raasanu and adi work ayyindi String replacedata = File.ReadAllText(@"C:\Users\Desktop1\Desktop\Replace\Replace.txt"); foreach (Match m in linkParser.Matches(replacedata)) Console.WriteLine(m.Value); Console.ReadLine(); nuvvu vaadina regex endhi final ga
bevarse Posted July 31, 2014 Author Report Posted July 31, 2014 nuvvu vaadina regex endhi final ga asalu ainadi paste cheyyadam marachitini
k2s Posted July 31, 2014 Report Posted July 31, 2014 help ki chala thanks bhayya but ippatiki ippudu chadivi adi ardam chesukoni implement cheyyadam kanna meelanti intelligent fellows ni adagadam easy ani asalu ainadi paste cheyyadam marachitini final ga emi sesinavo adi seffu man .
Recommended Posts