<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 18, 2013 at 12:12 AM, Martin Klapetek <span dir="ltr"><<a href="mailto:martin.klapetek@gmail.com" target="_blank">martin.klapetek@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hey,<div><br><div class="gmail_quote"><div class="im">On Tue, Jun 18, 2013 at 12:00 AM, Ahmed Ibrahim Khalil <span dir="ltr"><<a href="mailto:ahmedibrahimkhali@gmail.com" target="_blank">ahmedibrahimkhali@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Hi All,<br><br></div>I've taken a look at that bug. And also had taken a look at the mUrlRegExp inside the PostWidget.cpp file.<br>


<br><br></div><div>I am not good at RegExps so I thought to jump and ask the guys in Freenode's #regexp about a good regular expression, that matches this case and doesn't append the trailing character to the url.<br>


</div></div></blockquote><div><br></div></div><div>If you're looking for a good RegExp to match urls, we have one in kde-telepathy, which is borrowed from Konversation, which apparently went through years of improvements etc. The best thing is that it's a QRegExp already. We've been using it for years and it works just fine. Feel free to borrow it from here:</div>


<div><br></div><div><a href="http://quickgit.kde.org/?p=ktp-common-internals.git&a=blob&h=46cf566bf3e5388bc12f84dd27c41863d025acaf&hb=347988c448dd503d7f1c813dd5b96ac293bcd20a&f=KTp%2Ftext-parser.cpp" target="_blank">http://quickgit.kde.org/?p=ktp-common-internals.git&a=blob&h=46cf566bf3e5388bc12f84dd27c41863d025acaf&hb=347988c448dd503d7f1c813dd5b96ac293bcd20a&f=KTp%2Ftext-parser.cpp</a></div>


<div> </div></div></div></blockquote><div><br></div><div>Thanks alot Martin!<br>The QRegExp is working perfectly with trailing commas and quotes(that is what I tried).<br><br></div><div>I just took the part that negates the trailing characters (the [^\\s`!()\\[\\]{};:'\".,<>?%1%2%3%4%5%6] part)<br>
<br></div><div>And added it at the end to Choqok's QRegExp as I don't wont to modify it. <br>Maybe if Mehrdad said okay about replacing the current regexp with the one in KDE-Telepathy.<br><br></div><div>I've added the patch as an attachment so that everyone could see the change and if there is something wrong about it please inform me to correct it.<br>
<br></div><div>Thanks again Martin :)<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail_quote"><div></div>
</div><div>Cheers</div><span class=""><font color="#888888">-- <br><div><span style="color:rgb(102,102,102)">Martin Klapetek | KDE Developer</span></div>
</font></span></div>
</blockquote></div><br></div></div>