<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://regexadvice.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>RegexAdvice: Unanswered Threads</title><link>http://regexadvice.com/forums/TopicsNotAnswered.aspx</link><description>Posts that are unanswered</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 (Build: 60809.935)</generator><item><title>Look at my regex explorer</title><link>http://regexadvice.com/forums/thread/83618.aspx</link><pubDate>Sun, 31 Jul 2011 14:23:12 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:83618</guid><dc:creator>komandin.alexander</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/83618.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=83618</wfw:commentRss><description>&lt;p&gt;Look at my regex explorer&lt;/p&gt;&lt;p&gt;I would like to know opinion&lt;/p&gt;&lt;p&gt;http://gidavto.com/regexview.rar&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Area Code separate from Phone Number - concatenation</title><link>http://regexadvice.com/forums/thread/83268.aspx</link><pubDate>Fri, 17 Jun 2011 03:59:55 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:83268</guid><dc:creator>jwb4273</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/83268.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=83268</wfw:commentRss><description>&lt;p&gt;Hello all,&lt;/p&gt;&lt;p&gt;I am trying to get an expression to do the following:&lt;/p&gt;&lt;p&gt;1) Match regular 10 digit US phone number&lt;/p&gt;&lt;p&gt;2) Match 10 digit US phone number with a 1 or +1 in front (including country code)&lt;/p&gt;&lt;p&gt;3) Recognize a 7 digit number and grab the area code from the previous table cell.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;ve been able to piece together several separate regex strings to do certain pieces of this, but I can not figure out how to piece them together completely. &lt;/p&gt;&lt;p&gt;1 and 2 are handled by :&amp;nbsp;&amp;nbsp;\+?(1[\s-.]?)?((\(\d{3}\))|(\d{3}))[\s.\-]?\d{3}[\s.\-]?\d{4}&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;For 3, I&amp;#39;ve been able to make a regex identify the &amp;lt;td&amp;gt; cells by using &lt;/p&gt;&lt;p&gt;&amp;nbsp;(?:&amp;lt;td&amp;gt;|&amp;lt;td [^&amp;lt;]+?&amp;gt;)[\d\w\s\-]*((?!&amp;lt;/td&amp;gt;).)*&amp;lt;/td&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;and been able to find either the area code or 7 digit number by using &lt;/p&gt;&lt;p&gt;&amp;nbsp;(\d{3}|[\s.\-]?\d{4})&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;However, I can not make those latter 2 mesh up as necessary. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The sample HTML code for the last case is: &lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;								&lt;/span&gt;&amp;lt;td id=&amp;quot;wStr120Re_tab_re_tabpage_p_dw_p_grid_tbl_td_0_6&amp;quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;									&lt;/span&gt;TEXT&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;								&lt;/span&gt;&amp;lt;/td&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;								&lt;/span&gt;&amp;lt;td id=&amp;quot;wStr120Re_tab_re_tabpage_p_dw_p_grid_tbl_td_0_7&amp;quot; class=&amp;quot;center_align&amp;quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;									&lt;/span&gt;TEXT&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;								&lt;/span&gt;&amp;lt;/td&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;								&lt;/span&gt;&amp;lt;td id=&amp;quot;wStr120Re_tab_re_tabpage_p_dw_p_grid_tbl_td_0_8&amp;quot; class=&amp;quot;center_align&amp;quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;									&lt;/span&gt;512 &amp;lt;&amp;lt;&amp;lt; Areacode&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;								&lt;/span&gt;&amp;lt;/td&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;								&lt;/span&gt;&amp;lt;td id=&amp;quot;wStr120Re_tab_re_tabpage_p_dw_p_grid_tbl_td_0_9&amp;quot; class=&amp;quot;center_align&amp;quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;									&lt;/span&gt;111-2222 &amp;lt;&amp;lt;&amp;lt;&amp;lt; 7 digit phone number&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;								&lt;/span&gt;&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Ideally, the output from all 3 cases would be the complete 10 digit number. (the first 2 are obviously easy, the third it has to concatenate).&amp;nbsp;&lt;/p&gt;&lt;p&gt;Any assistance would be helpful! Thank you!&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Need help to shortest string in a match</title><link>http://regexadvice.com/forums/thread/82145.aspx</link><pubDate>Wed, 18 May 2011 22:39:31 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:82145</guid><dc:creator>chambarish</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/82145.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=82145</wfw:commentRss><description>&lt;p&gt;How to find shortest string, first occurance it should return&lt;/p&gt;&lt;p&gt;I have this string. I m looking for td whose value contains&amp;nbsp; blabla with closing td.&lt;/p&gt;&lt;p&gt;&amp;lt;tr blabla&amp;gt;&amp;lt;td&amp;gt;blabla big content&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;thisisnot&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/p&gt;&lt;p&gt;I want only this string &lt;strong&gt;&amp;lt;tr blabla&amp;gt;&amp;lt;td&amp;gt;blabla big content&amp;lt;/td&amp;gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;I m using this regex in .net&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&amp;lt;tr.*&amp;gt;&amp;lt;td&amp;gt;blabla.*&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;I m new to regex...&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Can any one tell me the way out.&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>rewrite wordpress search url</title><link>http://regexadvice.com/forums/thread/82009.aspx</link><pubDate>Wed, 11 May 2011 07:25:14 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:82009</guid><dc:creator>misterb</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/82009.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=82009</wfw:commentRss><description>&amp;nbsp;I need a regex to rewrite  with htaccess the permalink of a wordpress search query. This query is built this ways : http://example.com/&lt;b&gt;?s=queryterms1+queryterms2&lt;/b&gt; and can contains upper and lower case, and digits and any special character. &lt;p&gt;&amp;nbsp;I need this query to be rewritten into&amp;nbsp; http://example.com/&lt;b&gt;search/queryterms1+queryterms2.html&lt;/b&gt;&lt;/p&gt;&lt;p&gt;I tried a few but think that the &amp;quot;?&amp;quot; got me an error &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Regexp in Java to escape double quotes and  special cases.</title><link>http://regexadvice.com/forums/thread/80714.aspx</link><pubDate>Fri, 15 Apr 2011 21:39:48 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:80714</guid><dc:creator>Misha79</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/80714.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=80714</wfw:commentRss><description>&lt;p&gt;I &amp;nbsp;have a regex in Java to extract out &amp;nbsp;double-quoted text .&lt;/p&gt;&lt;p&gt;Regex in Java :&amp;nbsp;&lt;span style="color:#3834ff;font-family:Monaco;font-size:11px;" class="Apple-style-span"&gt;(\&amp;quot;\&amp;quot;|\&amp;quot;[\\s\\S]*?[^\\\\]\&amp;quot;)&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Input can be any String - .&lt;/p&gt;&lt;p&gt;But there can be cases where strings are : like &amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}span.s1 {text-decoration: underline}&lt;p class="p1"&gt;private&amp;nbsp;&lt;span class="s1"&gt;Regex&lt;/span&gt; path = new &lt;span class="s1"&gt;Regex&lt;/span&gt;(@&amp;quot;(?&amp;lt;!\S)(?&amp;lt;path&amp;gt;(http://|https://|hg://).+?)(\s+hg|\s*\-\-|[\&amp;quot;&amp;quot;\t\r\n]|$)&amp;quot;, RegexOptions.Compiled | RegexOptions.IgnoreCase);&amp;nbsp;&lt;/p&gt;&lt;p class="p1"&gt;private &amp;nbsp;&lt;span class="s1"&gt;Regex&lt;/span&gt; command = new &lt;span class="s1"&gt;Regex&lt;/span&gt;(@&amp;quot;(^clone$| clone$| clone |^clone )&amp;quot;, RegexOptions.Compiled | RegexOptions.IgnoreCase);&lt;/p&gt;&lt;p class="p1"&gt;&amp;nbsp;private &amp;nbsp;&lt;span class="s1"&gt;Regex&lt;/span&gt; username = new &lt;span class="s1"&gt;Regex&lt;/span&gt;(@&amp;quot;--&lt;span class="s1"&gt;username&lt;/span&gt;[\s]+([^\s\&amp;quot;&amp;quot;]+|\&amp;quot;&amp;quot;[^\&amp;quot;&amp;quot;]*\&amp;quot;&amp;quot;)&amp;quot;, RegexOptions.Compiled | RegexOptions.IgnoreCase);&lt;/p&gt;&lt;p class="p1"&gt;private &amp;nbsp;&lt;span class="s1"&gt;Regex&lt;/span&gt; passwd= new &lt;span class="s1"&gt;Regex&lt;/span&gt;(@&amp;quot;--password[\s]+([^\s\&amp;quot;&amp;quot;]+|\&amp;quot;&amp;quot;[^\&amp;quot;&amp;quot;]*\&amp;quot;&amp;quot;)&amp;quot;, RegexOptions.Compiled | RegexOptions.IgnoreCase);&lt;span style="font-family:Arial, Helvetica, sans-serif;font-size:13px;" class="Apple-style-span"&gt;&lt;span style="font-family:Monaco;font-size:11px;" class="Apple-style-span"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1"&gt;&lt;span style="font-family:Arial, Helvetica, sans-serif;font-size:13px;" class="Apple-style-span"&gt;&lt;span style="font-family:Monaco;font-size:11px;" class="Apple-style-span"&gt;private &amp;nbsp;&lt;span class="s1"&gt;Regex&lt;/span&gt;&amp;nbsp;error = new &lt;span class="s1"&gt;Regex&lt;/span&gt;(&amp;quot;(?:file &amp;#39;(?&amp;lt;file&amp;gt;.*?)&amp;#39;)|(?:Directory &amp;#39;(&amp;lt;file&amp;gt;.*?)&amp;#39;)&amp;quot;, RegexOptions.IgnoreCase);&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Now these are all-valid strings (or can say regexs ) in C# but if i feed these to my Java program ,it doesnt extract out double quotes well because of &amp;nbsp;&lt;span style="font-family:Monaco;font-size:11px;" class="Apple-style-span"&gt;\&amp;quot;&amp;quot; in all strings.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;if &amp;nbsp;i replace &amp;nbsp;it with &amp;quot;&amp;quot; everything is fine.&lt;/p&gt;&lt;p&gt;But i cannt change the input coming from different sources.I want my Java regex to handle this.&lt;/p&gt;&lt;p&gt;I know there can be many such cases to break the code.(if input can be from multiple sources,languages)but &amp;nbsp;atleast i know this one to handle.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;So please suggest me the addition to my regex to handle such cases.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Please ignore</title><link>http://regexadvice.com/forums/thread/80454.aspx</link><pubDate>Fri, 08 Apr 2011 01:39:34 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:80454</guid><dc:creator>porphyry5</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/80454.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=80454</wfw:commentRss><description>I duplicated my earlier post, because, when I looked to see if it had been answered I could not find it, yet when I posted the duplicate the original immediately appeared in the listing.&lt;br /&gt;</description></item><item><title>Regex Expert Job at CISCO in San Jose, California</title><link>http://regexadvice.com/forums/thread/78450.aspx</link><pubDate>Tue, 22 Feb 2011 16:34:12 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:78450</guid><dc:creator>Brent Rogers</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/78450.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=64&amp;PostID=78450</wfw:commentRss><description>&lt;font face="Arial"&gt;&lt;span style="font-size:11pt;"&gt;Our Security Technology Business Unit is looking for Senior Software Engineer that is an expert in Regular Expressions, JavaScript and Rewrite Engine. Please let me know if you can recommend anyone.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;Thanks in advance,&lt;br /&gt;Brent&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;b&gt; &lt;br /&gt;Senior Software Engineer (Rewrite Engine, Regular Expression, Parsers, JavaScript)&lt;br /&gt;&lt;/b&gt; &lt;br /&gt;Location &amp;ndash; San Jose, California&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:12pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:11pt;"&gt;Description&lt;br /&gt;Security Technology Business Unit (STBU) within WSRTG, is seeking a Software Engineer. STBU offers network and content security solutions that enable our customers to collaborate with confidence. These solutions include our firewall, intrusion prevention, remote access/VPN, unified client, web and email security.&lt;br /&gt;&lt;br /&gt;Responsibilities:&lt;br /&gt;Develop software for the Cisco Adaptive Security Appliance (ASA) and more specifically for the SSL VPN Remote Access component. Program in C, C++ and Javascript on a Linux-based platform with a slew of open source and proprietary libraries and infrastructure. Small team is central owner of WebVPN functionality; engage in all aspects of the product life-cycle from specification, design to development and post release maintenance. Great opportunity to employ a breadth of software engineering skills in a highly visible product.&lt;br /&gt;&lt;br /&gt;The successful candidate would have 3+ years of industry experience or more, would have experience working on large projects, analyzing and debugging Layer 7 protocols, writing parsers for high level languages and has written javascript to generate javascript. &lt;br /&gt;&lt;br /&gt;This candidate will show talent, passion and pride in software architecture, authorship and quality, excellent collaboration skills, teamwork and cross functional aptitude.&lt;br /&gt;&lt;br /&gt;Expertise in most of the following areas is required:&lt;br /&gt;&lt;br /&gt;* Flash decompilation&lt;br /&gt;* Unix/POSIX/Linux application level programming&lt;br /&gt;* Very strong Javascript development skills, with ability to use debuggers and profilers&lt;br /&gt;* Ability to diagnose issues with proprietary protocols&lt;br /&gt;* knowledge of parsers, regular expressions&lt;br /&gt;* Strong knowledge of the HTTP protocol and HTML&lt;br /&gt;* NTLM, SSL, character encoding&lt;br /&gt;* Differences between browsers, proxies&lt;br /&gt;* Experience with tools and frameworks like wireshark, Pcap, HTTPwatch, Spidermonkey, webkit&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Times New Roman"&gt;&lt;span style="font-size:12pt;"&gt; &lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-size:12pt;"&gt;&lt;font face="Arial"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Arial"&gt;&lt;font size="4"&gt;&lt;span style="font-size:14pt;"&gt;&lt;b&gt;Brent Rogers &amp;nbsp;&lt;/b&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#FD0000"&gt;&lt;font size="7"&gt;&lt;font face="Calibri, Verdana, Helvetica, Arial"&gt;&lt;span style="font-size:36pt;"&gt;&lt;b&gt;CISCO&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Arial"&gt;&lt;span style="font-size:12pt;"&gt;Recruiter&lt;br /&gt;&lt;hr align="CENTER" /&gt;&lt;/span&gt;&lt;span style="font-size:11pt;"&gt;&lt;b&gt;Email:&lt;/b&gt; &lt;font color="#0000FF"&gt;&lt;u&gt;&lt;a href="http://regexadvice.com/forums/breroger@cisco.com"&gt;breroger@cisco.com&lt;/a&gt;&lt;br /&gt;&lt;/u&gt;&lt;/font&gt;&lt;b&gt;Phone:&lt;/b&gt;&lt;/span&gt;&lt;font size="2"&gt;&lt;span style="font-size:10pt;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;span style="font-size:11pt;"&gt;972-813-4959&lt;br /&gt;&lt;b&gt;Mobile:&lt;/b&gt; 469-223-2085&lt;br /&gt;&lt;b&gt;LinkedIn:&lt;/b&gt; linkedin.com/in/hotjob&lt;br /&gt;&lt;b&gt;twitter:&lt;/b&gt; twitter.com/BrentRecruiter&lt;br /&gt;&lt;b&gt;Facebook:&lt;/b&gt; &lt;/span&gt;&lt;/font&gt;&lt;span style="font-size:11pt;"&gt;&lt;font color="#0000FF"&gt;&lt;font face="Calibri, Verdana, Helvetica, Arial"&gt;&lt;u&gt;&lt;a href="http://www.facebook.com/CiscoJobs"&gt;http://www.facebook.com/CiscoJobs&lt;/a&gt;&lt;br /&gt;&lt;/u&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Arial"&gt;&lt;b&gt;CISCO Job Link:&lt;/b&gt; CISCO.com/Jobs&lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Arial"&gt;&lt;span style="font-size:12pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;</description></item><item><title>REGULAR EXPRESSIOSN IN JAVASCRIPT FOR VALIDATION</title><link>http://regexadvice.com/forums/thread/74759.aspx</link><pubDate>Fri, 10 Dec 2010 06:21:33 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:74759</guid><dc:creator>visiontechno</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/74759.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=65&amp;PostID=74759</wfw:commentRss><description>&lt;p&gt;Regular Expressions provide a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters. Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns.
Some of the symbols used in regular expressions are as follows;
&lt;/p&gt;&lt;p&gt;1) Vertical Bar (|) &amp;ndash; This symbol is used to separate alternatives. Eg: rear|read can match both &amp;#39;rear&amp;#39; and &amp;#39;read&amp;#39;.
&lt;/p&gt;&lt;p&gt;2) Parenthesis (()) &amp;ndash; Defines the scope and precedence of operators. Eg: rea(r|d) can match both &amp;#39;rear&amp;#39; and &amp;#39;read&amp;#39;.
&lt;/p&gt;&lt;p&gt;3) Quantification Tokens &amp;ndash; There are a list of quantification tokens. Like:
&lt;/p&gt;&lt;p&gt;a) ? &amp;ndash; This denotes that there may be one or zero instance of the symbol present. Eg: rea?d can match both &amp;#39;read&amp;#39; and &amp;#39;red&amp;#39;
&lt;/p&gt;&lt;p&gt;b) * &amp;ndash; This denotes that there may be zero or more instance of the symbol present. Eg: rea*d can match all &amp;#39;read&amp;#39;,&amp;#39;red&amp;#39;,&amp;#39;reaaad&amp;#39;,&amp;#39;reaad&amp;#39; etc.
&lt;/p&gt;&lt;p&gt;c) + &amp;ndash; This denotes that there may be one or more instance of the symbol present. Eg: rea+d can match all &amp;#39;read&amp;#39;,&amp;#39;reaaaad&amp;#39;,&amp;#39;reaaad&amp;#39;,&amp;#39;reaad&amp;#39; etc
&lt;/p&gt;&lt;p&gt;These expression are of great use when we are checking for a particular pattern through our program in .Net/Javacript. Like it may be useful in checking for any presence of special characters in a username field. It may also come to use when we are validating a mobile number field against the entry of any alphanumeric value. If we know how to use this feature properly, then the time taken for validating several fields may reduce by &amp;frac12;
&lt;/p&gt;&lt;p&gt;Let us now see that how we can validate several instances using Javascript Regular Expressions. Eg:
&lt;/p&gt;&lt;p&gt;1) Validate against any blank values: 
&lt;/p&gt;&lt;p&gt;2) Validate against non &amp;ndash; words: 
&lt;/p&gt;&lt;p&gt;3) Validate against any blank values: &lt;/p&gt;&lt;p&gt;
4) Trimming a string &amp;ndash; Removing its left and right blank spaces:
&lt;/p&gt;&lt;p&gt;5) Validating an Email Address: 
&lt;/p&gt;&lt;p&gt;6) Validating a File Name: 
&lt;/p&gt;&lt;p&gt;To go through a thorough tutorial on this topic along with a Video Tutorial to undesrtand in a better way, please visit;

&lt;/p&gt;&lt;p&gt;&lt;a href="http://visiontechno.net/studymats/?cat=19" title="http://visiontechno.net/studymats/?cat=19 "&gt;http://visiontechno.net/studymats/?cat=19

&lt;/a&gt;&lt;/p&gt;</description></item><item><title>replace characters(seperators) within quotes</title><link>http://regexadvice.com/forums/thread/73979.aspx</link><pubDate>Thu, 18 Nov 2010 16:15:56 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:73979</guid><dc:creator>speedster</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/73979.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=73979</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Hi I am debugging a pear package (File_CSV).&lt;/p&gt;&lt;p&gt;At some point for a line all seperators within quotes need to be replaced with an underscore. &lt;/p&gt;&lt;p&gt;The code that is being used right now:&lt;/p&gt;&lt;p&gt;$orgLine = &amp;#39;1001;&amp;quot;test1&amp;quot;;&amp;quot;semicolon ; in this string&amp;quot; &amp;#39;; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;$line = preg_replace(&amp;quot;|^[^&amp;quot;\&amp;#39;;]*;*([&amp;quot;\&amp;#39;][^&amp;quot;\&amp;#39;]*[&amp;quot;\&amp;#39;])|sm&amp;quot;, &amp;#39;_&amp;#39;, $orgLine); &lt;/p&gt;&lt;p&gt;It is faulty. &lt;/p&gt;&lt;p&gt;I guess the tricky part is within quotes is valid only if lefthand quote-position= oneven and righthand quote-position=even , otherwise the semicolon is used as a seperator.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Anyone any suggestiones? &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Best freeware search and replace software</title><link>http://regexadvice.com/forums/thread/73704.aspx</link><pubDate>Wed, 10 Nov 2010 03:48:36 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:73704</guid><dc:creator>HowdeeDoodee</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/73704.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=65&amp;PostID=73704</wfw:commentRss><description>I need to search and replace over 200,000 html files. Because of the replace requirement I will likely have to use search and replace software to do the task. What is the best search and replace freeware that uses Regular Expressions?&lt;br /&gt;</description></item><item><title>Announcing Graphrex -- a graphical regular expression tool</title><link>http://regexadvice.com/forums/thread/69900.aspx</link><pubDate>Thu, 22 Jul 2010 21:12:09 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:69900</guid><dc:creator>CrotonResearch</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/69900.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=64&amp;PostID=69900</wfw:commentRss><description>&lt;p&gt;Announcing &lt;a href="http://crotonresearch.com/graphrex"&gt;Graphrex&lt;/a&gt;, a tool that analyzes a Java regular expression and creates a &lt;i&gt;&lt;b&gt;diagram&lt;/b&gt;&lt;/i&gt; with a visual representation of the regex&amp;#39;s structure and flow. Graphrex is a free plugin for the Eclipse IDE. Graphrex promotes the understanding, documentation and debugging of regular expressions.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://crotonresearch.com/graphrex"&gt;&lt;img src="http://crotonresearch.com/elverWP/wp-content/uploads/2010/05/GraphrexScreenshot_labeled2-300x225.png" title="Graphrex screenshot" alt="Graphrex screenshot" align="left" height="225" width="300" /&gt;&lt;/a&gt; Graphrex includes (1) a new resource type that Eclipse uses to store the diagram so that it can be saved and re-opened; (2) an editing area where the regular expression can be entered as text, with instant feedback on syntax errors; (3) the diagram, which has interactive features to allow you to select and zoom, or inspect the contents of character sets; (4) enhancements to the Eclipse UI to help you to manipulate your Graphrex diagram; and (5) a structured view that of the regular expression that is linked to the diagram, so that selecting something in the diagram selects it in the view, and vice versa.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Graphrex is a free plugin for Eclipse. Please take a look at the &lt;a href="http://crotonresearch.com/graphrex"&gt;website&lt;/a&gt; , download Graphrex and let us know what you think.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Regex string for AD search filter</title><link>http://regexadvice.com/forums/thread/69625.aspx</link><pubDate>Thu, 15 Jul 2010 21:22:07 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:69625</guid><dc:creator>radhikagupta5</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/69625.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=69625</wfw:commentRss><description>&lt;p&gt;Does anybody know of a Regex for AD search filter like,&lt;/p&gt;&lt;p&gt;&lt;font size="2" color="#008000"&gt;&lt;font size="2" color="#008000"&gt;(&amp;amp;(name=foo*)(objectCategory=computer)(objectClass=computer)(operatingSystem=Windows\20Server*))&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2" color="#008000"&gt;&lt;font size="2" color="#008000"&gt;&amp;nbsp;More details here: &lt;a href="http://msdn.microsoft.com/en-us/library/ms675768(v=VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms675768(v=VS.85).aspx&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2" color="#008000"&gt;&lt;font size="2" color="#008000"&gt;Thanks in advance.&lt;/font&gt;&lt;/font&gt;&lt;font size="2" color="#008000"&gt;&lt;font size="2" color="#008000"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;</description></item><item><title>URL redirect, probably very simple</title><link>http://regexadvice.com/forums/thread/69045.aspx</link><pubDate>Sun, 04 Jul 2010 16:17:59 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:69045</guid><dc:creator>marcus33cz</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/69045.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=69045</wfw:commentRss><description>&lt;p&gt;Hiya all,&lt;/p&gt;&lt;p&gt;I know it&amp;#39;s probably very simple but I still can&amp;#39;t get this redirect rule to work. I have a PHP website that uses links like this:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;http://www.its-not-yet-online.com/index.php?pg=./content/faq &lt;/b&gt;(which includes the file&lt;i&gt; ./content/faq.php &lt;/i&gt;to index.php&lt;i&gt;)&lt;/i&gt; or &lt;/li&gt;&lt;li&gt;&lt;b&gt;http://www.its-not-yet-online.com/index.php?pg=./content/article&amp;amp;id=10&lt;/b&gt; (which includes the file&lt;i&gt; ./content/article.php &lt;/i&gt;to index.php&lt;i&gt; &lt;/i&gt;and sets $_GET[&amp;#39;id&amp;#39;] to 10)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;And of course I want these links to look nice, so I used .htaccess and this regex:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;RewriteRule ^faq$&amp;nbsp; ./index.php?pg=./content/faq&lt;/b&gt;, this works and instead of www.&amp;times;&amp;times;&amp;times;.com/faq it shows the address with the pg parameter&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;RewriteRule ^article-(.+) ./index.php?pg=./content/article&amp;amp;id=$1, &lt;/b&gt;this also works&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Now to my question, I&amp;#39;d like to make these htaccess rules also &amp;quot;&lt;i&gt;reverse&lt;/i&gt;&amp;quot;. :-) So when you enter in your browser this:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;b&gt;http://www.its-not-yet-online.com/index.php?pg=./content/faq&lt;/b&gt;, it would redirect you to&amp;nbsp; &lt;b&gt;http://www.its-not-yet-online.com/faq &lt;/b&gt;using mod_rewrite [R] flag&lt;/p&gt;&lt;p&gt;BUT at the same time the address&lt;b&gt; http://www.its-not-yet-online.com/faq &lt;/b&gt;would SHOW the page &lt;b&gt;http://www.its-not-yet-online.com/index.php?pg=./content/faq&lt;/b&gt;&lt;/p&gt;&lt;p&gt;So how would you make this:::&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;RewriteRule ./index.php?pg=./content/&lt;i&gt;some_file&lt;/i&gt; &lt;i&gt;some_file&lt;/i&gt; [R]&lt;/li&gt;&lt;li&gt;RewriteRule ./index.php?pg=./content/&lt;i&gt;some_file&lt;/i&gt;&amp;amp;id=&lt;i&gt;identificator some&lt;/i&gt;&lt;i&gt;_file&lt;/i&gt;/&lt;i&gt;identificator&lt;/i&gt; [R]&lt;/li&gt;&lt;/ul&gt;The address&lt;b&gt; ./index.php?pg=./content/detail&amp;amp;id=contact&lt;/b&gt; would then redirect to &lt;b&gt;./detail/contact &lt;/b&gt;and&lt;br /&gt;the address&lt;b&gt; ./index.php?pg=./content/faq&lt;/b&gt; would 
then redirect to &lt;b&gt;./detail/faq&lt;/b&gt;&lt;br /&gt;&lt;p&gt;I tried to escape all sorts of different characters but I&amp;#39;ve always failed...&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Regular Expression for xml MatchPattern node (Help)</title><link>http://regexadvice.com/forums/thread/68279.aspx</link><pubDate>Sat, 19 Jun 2010 22:48:37 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:68279</guid><dc:creator>RegexNewbie</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/68279.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=68279</wfw:commentRss><description>&lt;p&gt;Helo everyone,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I am new here and today I had my first expression with Regular Expressions. I read for hours and I am trying but my expression doesnt work. I Have a xml that has the rules for extracting some values from a file to show them to thes users (the program is in VB). The file contains this line --&amp;gt;&lt;/p&gt;&lt;p&gt;Delivery: Phone:989909 Country:Blabla &lt;span style="white-space:pre;" class="Apple-tab-span"&gt;		&lt;/span&gt;Type1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A &amp;nbsp;1232&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;			&lt;/span&gt;Town:BLKAKAKAKK&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;	&lt;/span&gt; &amp;nbsp;Delivery: Phone:898989 Country:Blabla&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;			&lt;/span&gt;Type2334&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;		&lt;/span&gt;B &lt;span style="white-space:pre;" class="Apple-tab-span"&gt;	&lt;/span&gt;2223&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;			&lt;/span&gt;Town:ujhsuhwuhu jjjhj&lt;/p&gt;&lt;p&gt;&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;	&lt;/span&gt; &amp;nbsp;Delivery: Phone:122344 Country:Blabla &lt;span style="white-space:pre;" class="Apple-tab-span"&gt;		&lt;/span&gt;Type3 &lt;span style="white-space:pre;" class="Apple-tab-span"&gt;		&lt;/span&gt; &amp;nbsp;C&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;		&lt;/span&gt;2222&lt;span style="white-space:pre;" class="Apple-tab-span"&gt;				&lt;/span&gt;Town:uhuhuh&lt;/p&gt;&lt;p&gt;&amp;nbsp;I need the values (not numeric) A,B,C (len = 3) after the Strings&amp;nbsp;Type1,Type2334,Type3 and before the&amp;nbsp;Town String. The four Strings are Const. So I have created the following Regex for the xml--&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;MatchPattern&amp;gt;&amp;lt;![CDATA[(?&amp;lt;=Type1|Type2334|Type3\s+).{1,17}\s*.{1,17}\s*)]]&amp;gt;&amp;lt;/MatchPattern&amp;gt;&lt;/p&gt;&lt;p&gt;?&amp;lt;=Type1|Type2334|Type3\s+).{1,17}\s*.{1,17}\s*&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;It works fine but sometimes I&amp;nbsp;&amp;nbsp;get the wrong result. Thats because the length of the String is &amp;nbsp;not allways the same and the spaces are too many... I have no Idea what I can do to solve this problem. I have tried to combine the negative lookahead but it doesnt work --&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;MatchPattern&amp;gt;&amp;lt;![CDATA[(?&amp;lt;=Type1|Type2334|Type3\s+).{1,17}\s*.{1,17}\s*(?&amp;lt;!Town\s+)]]&amp;gt;&amp;lt;/MatchPattern&amp;gt; &amp;nbsp;(I dont remember right now the syntax for a negativ lookahead).&lt;/p&gt;&lt;p&gt;The result was nothing. I need really Help. Please tell me also if there is a way to ignore spaces. Thank you very Much! &amp;nbsp;The XML Code follows --&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;lt;DocFields&amp;gt;&amp;lt;ID&amp;gt;DocSeries&amp;lt;/ID&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;fDocTypeID&amp;gt;A&amp;lt;/fDocTypeID&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;FromTop&amp;gt;true&amp;lt;/FromTop&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;StartRow&amp;gt;15&amp;lt;/StartRow&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;StartColumn&amp;gt;1&amp;lt;/StartColumn&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;Width&amp;gt;158&amp;lt;/Width&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;Height&amp;gt;1&amp;lt;/Height&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;MatchPattern&amp;gt;&amp;lt;![CDATA[(?&amp;lt;=Type1|Type2334|Type3\s+).{1,17}\s*.{1,17}\s*)]]&amp;gt;&amp;lt;/MatchPattern&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;Optional&amp;gt;false&amp;lt;/Optional&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/DocFields&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Replacing characters with RegEx values</title><link>http://regexadvice.com/forums/thread/68053.aspx</link><pubDate>Wed, 16 Jun 2010 08:14:55 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:68053</guid><dc:creator>Jaxx</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/68053.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=68053</wfw:commentRss><description>&lt;p&gt;Hi!&lt;/p&gt;&lt;p&gt;I have a list of german words like this:&lt;/p&gt;&lt;p&gt;fu&amp;szlig;, m&amp;uuml;&amp;szlig;ig, flei&amp;szlig;ig, muss, m&amp;auml;&amp;szlig;ig&lt;/p&gt;&lt;p&gt;In my program I have to search this list for some words which are in another list. My Problem:&lt;/p&gt;&lt;p&gt;In German language you can write the characters &amp;auml;, &amp;ouml;, &amp;uuml; and &amp;szlig; also like ae, oe, ue, ss. Now I need to prepare the words in the list like this:&lt;/p&gt;&lt;p&gt;&amp;nbsp;fu(&amp;szlig;|ss), m(&amp;uuml;|ue)(&amp;szlig;|ss)ig, flei(&amp;szlig;|ss)ig, mu(&amp;szlig;|ss), m(&amp;auml;|ae)(&amp;szlig;|ss)ig&lt;/p&gt;&lt;p&gt;In my program this RegEx will then be parsed and checked against the other list. I already did this replacement with the code in my program (for example: Regex.Replace(words, &amp;quot;(&amp;auml;|ae)&amp;quot;, &amp;quot;(&amp;auml;|ae)&amp;quot;)) but I have to do this character by character. Can anybody tell me the RegEx to replace the all the characters at once?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Best regards&lt;/p&gt;&lt;p&gt;Jaxx &lt;br /&gt;&lt;/p&gt;&lt;p&gt;;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Replace only if match found</title><link>http://regexadvice.com/forums/thread/67929.aspx</link><pubDate>Mon, 14 Jun 2010 19:18:25 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:67929</guid><dc:creator>meason</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/67929.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=67929</wfw:commentRss><description>&lt;p&gt;Trying to set up a URL replace in IIS 7 so I have one line for a regex and one line for a replace string.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Example strings I&amp;#39;m trying to match&lt;/p&gt;&lt;p&gt;1) /type-style_123_s456.html&lt;/p&gt;&lt;p&gt;2) /type_123.html?s=456&lt;/p&gt;&lt;p&gt;&amp;nbsp;Trying to get it to end up as&lt;/p&gt;&lt;p&gt;/page.aspx?t=123&amp;amp;s=456&lt;/p&gt;&lt;p&gt;I&amp;#39;ve gotten as far as&lt;/p&gt;&lt;p&gt;^/?[^_/]+_*([0-9]*)(?:_+s([0-9]*))*\.html\?*(.*)$&lt;/p&gt;&lt;p&gt;with the replace string as &lt;/p&gt;&lt;p&gt;/page.aspx?t=$1&amp;amp;s=$2&amp;amp;$3&lt;/p&gt;&lt;p&gt;&amp;nbsp;This works in the first case which creates /page.aspx?t=123&amp;amp;s=456&amp;amp; but in the second case it creates /page.aspx?t=123&amp;amp;s=&amp;amp;s=456. This creates an error because there is now two &amp;quot;s&amp;quot; in the new string.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Can I make the &amp;amp;s= only appear in the new string if it was matched in the original?&lt;/p&gt;&lt;p&gt;&amp;nbsp;The final (.*) is necessary because it needs to grab anything remaining on the querystring.&lt;/p&gt;&lt;p&gt;The full expression also takes more then the two parameters above which I&amp;#39;ve shown below if that has any bearing on suggestions.&lt;/p&gt;&lt;p&gt;^/?[^_/]+_*([0-9]*)(?:_+m([0-9]*))*(?:_+s([0-9]*))*(?:_+oa([0-9]*)-([0-9]*))*(?:_+ob([0-9]*)-([0-9]*))*\.html\?*(.*)$&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt;/products/default.aspx?tid=&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;R&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font size="2"&gt;:1&lt;/font&gt;&lt;/b&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;amp;mfr=&lt;/font&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;R&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font size="2"&gt;:2&lt;/font&gt;&lt;/b&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;amp;st=&lt;/font&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;R&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font size="2"&gt;:3&lt;/font&gt;&lt;/b&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;amp;o&lt;/font&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;R&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font size="2"&gt;:4&lt;/font&gt;&lt;/b&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;=&lt;/font&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;R&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font size="2"&gt;:5&lt;/font&gt;&lt;/b&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;amp;o&lt;/font&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;R&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font size="2"&gt;:6&lt;/font&gt;&lt;/b&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;=&lt;/font&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;R&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font size="2"&gt;:7&lt;/font&gt;&lt;/b&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;?&lt;/font&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;R&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font size="2"&gt;:8&lt;/font&gt;&lt;/b&gt;&lt;font size="2" color="#a52a2a"&gt;&lt;font size="2" color="#a52a2a"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;p&gt;&amp;nbsp;Thanks in advance.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>explain this regex for me.</title><link>http://regexadvice.com/forums/thread/67585.aspx</link><pubDate>Tue, 08 Jun 2010 09:41:55 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:67585</guid><dc:creator>jack2006</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/67585.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=67585</wfw:commentRss><description>&lt;p&gt;I write&amp;nbsp;it with&amp;nbsp;Javscript. Thank you.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; if (&amp;nbsp; /^[\],:{}\s]*$/.&lt;br /&gt;test(text.replace(/\\(?:[&amp;quot;&lt;span style="color:#333300;"&gt;\\\/bfnrt]|u[0-9a-fA-F]{4})/g&lt;/span&gt;&lt;span style="color:#333300;"&gt;,&lt;/span&gt; &lt;a href="mailto:&amp;#39;@&amp;#39;"&gt;&lt;span style="color:#333300;"&gt;&amp;#39;@&amp;#39;&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#333300;"&gt;).&lt;br /&gt;replace(/&amp;quot;[^&amp;quot;&lt;/span&gt;&lt;span style="color:#333300;"&gt;\\\n\r]*&amp;quot;|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g&lt;/span&gt;&lt;span style="color:#333300;"&gt;, &amp;#39;]&amp;#39;).&lt;br /&gt;replace(/(?:^|:|,)(?:\s*\[)+/g, &amp;#39;&amp;#39;))&amp;nbsp; ) &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#333300;"&gt;&lt;/span&gt;&lt;span style="color:#333300;"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#333300;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#333300;"&gt;//do something&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#333300;"&gt;}&lt;/span&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Regular Expression in MySql 'SELECT' query </title><link>http://regexadvice.com/forums/thread/67450.aspx</link><pubDate>Fri, 04 Jun 2010 19:10:14 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:67450</guid><dc:creator>bluesapphire</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/67450.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=67450</wfw:commentRss><description>&lt;div&gt;Hi!&lt;br /&gt;I have following regex in PHP :&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;$url = &amp;#39;http://www.google.co.uk/webmail/&amp;#39;;&lt;br /&gt;&lt;br /&gt;preg_match(&amp;quot;#^(?:http://)?(?:www\.)?([^/]+)#i&amp;quot;,$url, $matches);&lt;br /&gt;echo $host = $matches[1];&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;How can I implement/convert above mentioned regex in Mysql &amp;#39;Select&amp;#39; query, so that I shall be able to match/find only and only domain names from stored records of table.&lt;br /&gt;&lt;br /&gt;Thanks in advance&lt;/div&gt;</description></item><item><title>[solved] simple regex question danish school grades</title><link>http://regexadvice.com/forums/thread/65804.aspx</link><pubDate>Thu, 20 May 2010 16:16:50 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:65804</guid><dc:creator>Andreas Christoffersen</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/65804.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=65804</wfw:commentRss><description>&lt;p&gt;Hi,&lt;br /&gt;
&lt;br /&gt;
I am struggeling with regex. But I am suprised that this simple piece does not work&lt;/p&gt;
&lt;p&gt;&lt;code class="php"&gt;/^([-3]|[00]|[0]|[02]|[2]|[4]|[7]|[10]|[12])$/&lt;/code&gt; &lt;br /&gt;
&lt;/p&gt;&lt;p&gt;

I will only accept &lt;br /&gt;
-3,&lt;br /&gt;
00,&lt;br /&gt;
0,&lt;br /&gt;
03,&lt;br /&gt;
2&lt;br /&gt;
4&lt;br /&gt;
7&lt;br /&gt;
10&lt;br /&gt;
12&lt;br /&gt;
&lt;br /&gt;
(danish school grades). But the regex above produces an error on 00 and 02?&lt;br /&gt;
&lt;br /&gt;
ANy help much appreciated - thanks.&lt;/p&gt;&lt;p&gt;Andreas &lt;/p&gt;&lt;p&gt;Edit: Solved: Thanks to holc on limesurvey forum: The square brackets was the problem. Removing them saves the day. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>- Sorry... just spotted my mistake... -</title><link>http://regexadvice.com/forums/thread/64637.aspx</link><pubDate>Mon, 03 May 2010 20:25:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:64637</guid><dc:creator>NyghtWyng</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/64637.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=64637</wfw:commentRss><description>Sorry to bother anyone... just saw my mistake.&amp;nbsp; *sigh*&lt;br /&gt;</description></item><item><title>RESOLVED: img src recuperation to transform relative URL in absolutes links with attributes html php</title><link>http://regexadvice.com/forums/thread/63682.aspx</link><pubDate>Sun, 11 Apr 2010 16:00:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:63682</guid><dc:creator>bZx</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/63682.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=63682</wfw:commentRss><description>&lt;p style="font-size:20px;line-height:24px;"&gt;&amp;lt;img(\s[^\&amp;gt;]*)? src=(?:\&amp;quot;|\&amp;#39;|&amp;amp;quot;)images\/([^\&amp;gt;\&amp;quot;\&amp;#39;]+)(?:\&amp;quot;|\&amp;#39;|&amp;amp;quot;)(\s[^\&amp;gt;\/]*)?\s?\/?\s?&amp;gt; &lt;br /&gt;&lt;/p&gt;&lt;p style="font-size:20px;line-height:24px;"&gt;I replace&lt;br style="font-size:20px;line-height:24px;" /&gt;&amp;lt;img width=&amp;quot;42&amp;quot; src=&amp;quot;images/test/test2.jpg&amp;quot; height=&amp;quot;42&amp;quot; anyOtherAttribute=&amp;quot;42&amp;quot; &amp;gt;&lt;br style="font-size:20px;line-height:24px;" /&gt;or any other relative images src starting with images with:&lt;br style="font-size:20px;line-height:24px;" /&gt;&amp;lt;img src=&amp;quot;/rdb/images/test/test2.jpg&amp;quot; width=&amp;quot;42&amp;quot; height=&amp;quot;42&amp;quot; anyOtherAttribute=&amp;quot;42&amp;quot; &amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="font-size:20px;line-height:24px;"&gt;I used this regex in a PHP5 script with the preg_replace function hosted with 1and1.fr.&lt;br /&gt;original PHP code line:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $text=preg_replace(&amp;quot;/&amp;lt;img(\s[^\&amp;gt;]*)? src=(?:\&amp;quot;|\&amp;#39;|&amp;amp;quot;)images\/([^\&amp;gt;\&amp;quot;\&amp;#39;]+)(?:\&amp;quot;|\&amp;#39;|&amp;amp;quot;)(\s[^\&amp;gt;\/]*)?\s?\/?\s?&amp;gt;/&amp;quot;,&amp;quot;&amp;lt;img$1 src=\&amp;quot;/rdb/images/$2\&amp;quot; $3&amp;gt;&amp;quot;,$text);&lt;br /&gt;The website is http://www.reves-de-bois.fr.&lt;br style="font-size:20px;line-height:24px;" /&gt;&lt;/p&gt;</description></item><item><title>search&amp;replace operation - Perl</title><link>http://regexadvice.com/forums/thread/62867.aspx</link><pubDate>Wed, 31 Mar 2010 17:14:38 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:62867</guid><dc:creator>pmj1989</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/62867.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=62867</wfw:commentRss><description>&lt;p&gt;Hello!

&lt;/p&gt;&lt;p&gt;I am working on a search&amp;amp;replace regex for Mp3tag, a tool managing audio metadata, which as far as I know is based on Perl-engine. I would like it to study the content of a text field and change it according to specified pattern.

&lt;/p&gt;&lt;p&gt;THE PATTERN 
(It&amp;#39;s easier to explain with examples)&lt;/p&gt;&lt;p&gt;from -&amp;gt; to

&lt;/p&gt;&lt;p&gt;COMPOSER_1 -&amp;gt; COMPOSER_1&lt;br /&gt;COMPOSER_1, COMPOSER_2 -&amp;gt; 
COMPOSER_1\\COMPOSER_2&lt;br /&gt;COMPOSER_1, co-produced by COMPOSER_2 -&amp;gt; 
COMPOSER_1\\COMPOSER_2 (co-prod.)&lt;br /&gt;COMPOSER_1, COMPOSER_2, co-produced
 by COMPOSER_3, COMPOSER_4 -&amp;gt; COMPOSER_1\\COMPOSER_2\\COMPOSER_3 
(co-prod.)\\COMPOSER_4 (co-prod.)&lt;/p&gt;&lt;p&gt;The problem is the limitation of the reapeted backrefernce which captures only the last match :/ Any workarounds for that? &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Extract text field inside quotation marks</title><link>http://regexadvice.com/forums/thread/62318.aspx</link><pubDate>Thu, 25 Mar 2010 14:25:40 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:62318</guid><dc:creator>MultiMarine</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/62318.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=62318</wfw:commentRss><description>&lt;p&gt;I use c# and .NET.&amp;nbsp;&lt;/p&gt;&lt;p&gt;I have this text string where i need to extract different fields seperated by one or more spaces. &lt;br /&gt;All fields can be in optional quotation marks.&lt;/p&gt;&lt;p&gt;Here is the line with the fields:&lt;/p&gt;&lt;p&gt;#VER A 365 20080722 &amp;quot;This \&amp;quot;is\&amp;quot; some text&amp;quot; 20090614&lt;/p&gt;&lt;p&gt;I have gotten this far:&lt;/p&gt;&lt;p&gt;#VER A 365 20080722 &lt;/p&gt;&lt;p&gt;Using this expression.&lt;/p&gt;&lt;p&gt;^\s*\#VER\s+(&amp;quot;?)(?&amp;lt;type&amp;gt;\w+)\1\s+(&amp;quot;?)(?&amp;lt;number&amp;gt;\d+)\2\s+(&amp;quot;?)(?&amp;lt;date&amp;gt;\d{8})\3\s+&lt;/p&gt;&lt;p&gt;The problem is the text part. This field allow spaces if it&amp;#39;s in quotation marks, otherwise spaces are not allowed.&lt;br /&gt;The field also allows quotation marks to be part of the text if it is preceded with a backslash(\&amp;quot;).&lt;/p&gt;&lt;p&gt;Text field examples:&lt;/p&gt;&lt;p&gt;&amp;quot;This \&amp;quot;is\&amp;quot; some text&amp;quot; -&amp;gt; This &amp;quot;is&amp;quot; some text&lt;br /&gt;&amp;quot;JustAWord&amp;quot; &amp;nbsp;&amp;nbsp;-&amp;gt; JustAWord&lt;br /&gt;\&amp;quot;JustAWord\&amp;quot; &amp;nbsp;&amp;nbsp;-&amp;gt; &amp;quot;JustAWord&amp;quot;&lt;/p&gt;&lt;p&gt;The text allow all characters except [\x00-\x1F\x7F]. &lt;br /&gt;So [^\x00-\x1F\x7F] for text with and [^\x00-\x1F\x7F\s] for text without quotation marks can be used.&lt;/p&gt;&lt;p&gt;How do i extract this text?&lt;/p&gt;&lt;p&gt;Help very much appreciated!&lt;/p&gt;</description></item><item><title>append slash to url (if not a file)</title><link>http://regexadvice.com/forums/thread/60289.aspx</link><pubDate>Tue, 02 Mar 2010 21:39:00 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:60289</guid><dc:creator>chrisd</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/60289.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=60289</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I&amp;#39;ve been racking my brain without success (writer&amp;#39;s block combined with inexperience?).&lt;/p&gt;&lt;p&gt;I need to append a slash (only) if there isn&amp;#39;t already a 3-4 letter extension. I&amp;#39;m using IIS7&amp;#39;s url rewrite module.&lt;/p&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;p&gt;&lt;a href="http://mydomain.com/mypage"&gt;http://mydomain.com/mypage&lt;/a&gt;&amp;nbsp;becomes &lt;a href="http://mydomain.com/mypage/"&gt;http://mydomain.com/mypage/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;While &lt;a href="http://mydomain.com/mypage1.aspx"&gt;http://mydomain.com/mypage1.aspx&lt;/a&gt; or &lt;a href="http://mydomain.com/mypage/"&gt;http://mydomain.com/mypage/&lt;/a&gt;&amp;nbsp;are left alone.&lt;/p&gt;&lt;p&gt;Anyone have any pointers?&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Looking for RegEx Expert Consultant</title><link>http://regexadvice.com/forums/thread/60185.aspx</link><pubDate>Sat, 27 Feb 2010 19:08:40 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:60185</guid><dc:creator>tpd</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/60185.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=65&amp;PostID=60185</wfw:commentRss><description>&lt;span style="font-size:12pt;font-family:'Calibri','sans-serif';"&gt;Hi,&lt;br /&gt;&lt;br /&gt;I am looking to engage an on-call ReGex expert to develop some custom expressions for&amp;nbsp;our ongoing projects.&amp;nbsp; Work could be lump-sum or hourly - it just depends on the nature of the data we are trying to extract/cleanup. I would guesstimate 5-10 hours per month for the next few months.&lt;br /&gt;&lt;br /&gt;A US-Taxpayer ID is perferred but may not be essential.&amp;nbsp; If you are interested, please feel free to email me your qualifications and any examples of your work that you feel demonstrate your level of expertise in RegEx.&lt;br /&gt;&lt;br /&gt;I hope to contract with someone in the next week or so.&lt;br /&gt;&lt;br /&gt;Thanks for your interest -&lt;br /&gt;&lt;br /&gt;Tom Danaher&lt;br /&gt;Haley &amp;amp; Aldrich, Inc.&lt;br /&gt;&lt;a href="http://www.haleyaldrich.com/"&gt;www.haleyaldrich.com&lt;/a&gt;&lt;br /&gt;tpd at haleyaldrich dotcom&lt;/span&gt;</description></item></channel></rss>