<?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>Construction Advice</title><link>http://regexadvice.com/forums/68/ShowForum.aspx</link><description>&lt;P&gt;Find help building expressions to suit your needs. Consult the &lt;A href="http://regexlib.com"&gt;Regular Expression Library&lt;/A&gt; to find many pre-built expressions, and add your own once you've solved your construction problem in our forum.&lt;/P&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2.1 (Build: 60809.935)</generator><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/57902.aspx</link><pubDate>Thu, 17 Dec 2009 13:35:29 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:57902</guid><dc:creator>mays</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/57902.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=57902</wfw:commentRss><description>&lt;p&gt;I too same across this hidden IE6 demon and remained clueless for a couple of days. Thanks mash for helping me out. &lt;/p&gt;&lt;p&gt;Agreeing to mash&amp;#39;s findings that in IE , &lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;While finding the lower count for occurrences, counting starts from the end of the first lookahead match. Albeit this, final matches will be made only from the start of the string. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;For upper count, behavior is as expected.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Work around would be to include the occurrence count in to a lookahead ( which is the solution stated above). &lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Please correct me if I&amp;#39;m wrong. &lt;/p&gt;&lt;p&gt;Now for my case, for the spite of quick and dirty developers , if you need a password matching expression which does ,&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Must contain minimum 8 to 12 characters, mandatorily including one letter and number &lt;/li&gt;&lt;li&gt;May include only one of the following special characters: %,&amp;amp;, _, ?, #, =, -&lt;/li&gt;&lt;li&gt;Cannot have any spaces&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;Use : /(?=^[\w%&amp;amp;?#=-]{8,12}$)(?=.+\d)(?=.+[a-zA-Z]).+/&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;(?=^[\w%&amp;amp;?#=-]{8,12}$)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Look ahead which matches the special char pattern + does the occurrence count &lt;br /&gt;(?=.+\d)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : matches atleast one digit&lt;br /&gt;(?=.+[a-zA-Z])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : matches atleast one alphabet&lt;br /&gt;.+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; : filler for the chars&amp;nbsp; &lt;br /&gt;&lt;/blockquote&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Another catch, for the same JScript engine version 5.7 , IE8 doesnt show this behaviour. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/51060.aspx</link><pubDate>Sat, 21 Feb 2009 19:48:37 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51060</guid><dc:creator>mash</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51060.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51060</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://regexadvice.com/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;gracias86:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;Dear mash, thanks for helping me! your pattern works correctly!&lt;/p&gt;&lt;p&gt;By the way, may i know what&amp;#39;s causing the bug, and how to avoid this so in the future i might know how to deal with it?. Thanks also for everyone that helping me to figure out the problem (Aussie Susan especially). &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;My new theory is the it&amp;#39;s a bug in the DLL for VBScript.&amp;nbsp; I&amp;#39;ve writtten about what I think is happening here &lt;a href="http://regexadvice.com/blogs/mash/archive/2009/02/21/Looking-again-at-the-Lookahead-bug.aspx"&gt;http://regexadvice.com/blogs/mash/archive/2009/02/21/Looking-again-at-the-Lookahead-bug.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;But the short answer for avoiding it is for strong password type regexes test the length first.&amp;nbsp; Don&amp;#39;t know it that will work for every pattern though. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/51055.aspx</link><pubDate>Sat, 21 Feb 2009 02:51:54 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51055</guid><dc:creator>gracias86</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51055.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51055</wfw:commentRss><description>&lt;p&gt;Dear mash, thanks for helping me! your pattern works correctly!&lt;/p&gt;&lt;p&gt;By the way, may i know what&amp;#39;s causing the bug, and how to avoid this so in the future i might know how to deal with it?. Thanks also for everyone that helping me to figure out the problem (Aussie Susan especially). &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/51049.aspx</link><pubDate>Fri, 20 Feb 2009 17:08:02 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51049</guid><dc:creator>mash</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51049.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51049</wfw:commentRss><description>&lt;p&gt;&lt;strong&gt;gracias86, you&amp;#39;ve been bitten by a Microsoft bug!&amp;nbsp; The pattern as written is correct but there is a bug with the lookahead construct in the VBScript regex engine.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I think it the same bug that I wrote about a few years ago, or at least related to it.&amp;nbsp; I will go into in more detail when I have some time, maybe after work tonight.&lt;/p&gt;

&lt;p&gt;In the mean time try this pattern instead, It should work around the bug.&lt;br /&gt;
&lt;/p&gt;

&lt;p style="color:#00ff00;"&gt;^(?=.{6,8}$)(?=\D+\d)[a-z][a-z0-9]+$&lt;br /&gt;
&lt;/p&gt;</description></item><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/51042.aspx</link><pubDate>Fri, 20 Feb 2009 11:37:50 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51042</guid><dc:creator>gracias86</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51042.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51042</wfw:commentRss><description>&lt;p&gt;all right, i will put the full code here to clear the confusion:&lt;/p&gt;&lt;p&gt;-------&lt;b&gt;&amp;nbsp;Testing.htm&lt;/b&gt;--------------------------------------------------------------------------------------------- -------------------------------------&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;lt;HTML&amp;gt;&lt;br /&gt;&amp;lt;HEAD&amp;gt;&lt;br /&gt;&amp;lt;TITLE&amp;gt;Administrator Page&amp;lt;/TITLE&amp;gt;&lt;br /&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;webs.css&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/HEAD&amp;gt;&lt;br /&gt;&amp;lt;BODY&amp;gt;&lt;br /&gt;&amp;lt;form method=&amp;quot;post&amp;quot; action=&amp;quot;http://localhost/&lt;b&gt;adminLog.asp&lt;/b&gt;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Warning!&amp;nbsp; &amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;h2&amp;gt; This page is for administrator only! &amp;lt;/h2&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt; Click &amp;lt;a href=&amp;quot;Asg1.htm&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt; if you are student or not an administrator &amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;h5&amp;gt; User Name:&amp;nbsp; &amp;lt;input size=&amp;quot;15&amp;quot; name=&amp;quot;users&amp;quot; type=&amp;quot;text&amp;quot;&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;&amp;nbsp;Password&amp;nbsp; :&amp;nbsp; &amp;lt;input size=&amp;quot;15&amp;quot; name=&amp;quot;pass&amp;quot; type=&amp;quot;password&amp;quot;&amp;gt;&amp;lt;/h5&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;h5&amp;gt;&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Submit&amp;quot; id=&amp;quot;submit1&amp;quot; name=&amp;quot;submit1&amp;quot;&amp;gt;&amp;lt;/h5&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/BODY&amp;gt;&lt;br /&gt;&amp;lt;/HTML&amp;gt; &lt;/p&gt;&lt;p&gt;--------------------------------------------------------------------------------------------------------------------------------- &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;b&gt;adminLog.htm&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;% @language=&amp;quot;vbscript&amp;quot; %&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;adminOutput&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;%&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim userName, password&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; userName = Request.Form(&amp;quot;users&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; password = Request.Form(&amp;quot;pass&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set conn = server.createObject(&amp;quot;ADODB.Connection&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set rs = server.createObject(&amp;quot;ADODB.RecordSet&amp;quot;)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; conn.Open &amp;quot;DSN=DataWebDSN&amp;quot; --&amp;gt; will deal with database later, but had to validate first&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (ValidatePassword(password)) Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sql = &amp;quot;SELECT * FROM Admin &amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set rs = conn.Execute(sql)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Redirect(&amp;quot;errorAdmin.htm&amp;quot;) --&amp;gt; here just show error message&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&lt;br /&gt;Do While NOT rs.EOF&lt;br /&gt;If (userName = rs(&amp;quot;User_Name&amp;quot;)) Then&lt;br /&gt;Response.Write(&amp;quot;Login Successful!&amp;quot;&amp;nbsp; &amp;amp; &amp;quot;&amp;lt;br&amp;gt;&amp;quot;)&lt;br /&gt;Response.Write(&amp;quot;Welcome Administrator! &amp;quot; &amp;amp; &amp;quot;&amp;lt;br&amp;gt;&amp;quot;)&lt;br /&gt;Response.Write(&amp;quot;Your password: &amp;quot; &amp;amp; password )&lt;br /&gt;&lt;br /&gt;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Redirect(&amp;quot;errorAdmin.htm&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end if&lt;br /&gt;&lt;br /&gt;rs.movenext&lt;br /&gt;Loop&lt;br /&gt;rs.close&lt;br /&gt;set rs=nothing&lt;br /&gt;conn.Close&lt;br /&gt;Set conn = Nothing&lt;br /&gt;&lt;br /&gt;Function ValidatePassword(strPassword)&lt;br /&gt;&amp;nbsp; Dim re&lt;br /&gt;&amp;nbsp; Set re = new RegExp&lt;br /&gt;&lt;br /&gt;&amp;nbsp; re.IgnoreCase = true&lt;br /&gt;&amp;nbsp; re.global = false&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;b&gt; re.Pattern = &amp;quot;^(?=.*?\d)[a-z][a-z0-9]{5,7}$&amp;quot;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; ValidatePassword = re.Test(strPassword)&lt;br /&gt;End Function &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;---------------------------------------------------------------------------------------------------&lt;/p&gt;&lt;p&gt;ok, now for the error i got: i always got redirected to to &amp;quot;errorAdmin.htm&amp;quot;, which means the validation function is wrong. again, however it works properly when i did not put the (?=.*\d).&lt;/p&gt;&lt;p&gt;I&amp;#39;m using Internet Explorer version 7.0.5730.13&lt;/p&gt;&lt;p&gt;this is the input that failed and success to validate:&lt;/p&gt;&lt;p&gt;&amp;quot;abc123&amp;quot; -&amp;gt; failed&lt;/p&gt;&lt;p&gt;&amp;quot;abcdef12&amp;quot; -&amp;gt; failed&lt;/p&gt;&lt;p&gt;&amp;quot;aaaaa1&amp;quot; -&amp;gt; failed&lt;/p&gt;&lt;p&gt;&amp;quot;abc12ab1&amp;quot; -&amp;gt; failed &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;quot;a12bc13&amp;quot; -&amp;gt; success&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;quot;ab121212&amp;quot; -&amp;gt; success&lt;/p&gt;&lt;p&gt;&amp;quot;adminOutputab12abc1&amp;quot; -&amp;gt; success &lt;/p&gt;&lt;p&gt;&amp;nbsp; Any other info please let me know,&lt;/p&gt;&lt;p&gt;Thanks &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/51037.aspx</link><pubDate>Fri, 20 Feb 2009 06:45:21 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51037</guid><dc:creator>Aussie Susan</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51037.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51037</wfw:commentRss><description>&lt;p&gt;Please note that the pattern quantifier is &amp;quot;{5,7}&amp;quot; - those are curly braces and not square ones. Also, remember that the quantifier only applies to the single item that immediately precedes it, in this case the &amp;quot;\w&amp;quot;. Therefore there will be between 5 and 7 matches based on this. However, there is a &amp;quot;[a-z]&amp;quot; before that which will match a single character - hence the 6 to 8 character match overall.&lt;/p&gt;&lt;p&gt;From what I read, there is no difference to the regex engine that is used whether you use VBScript or Javascript - the difference it at the programming language level and not the regex level.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Susan&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/51034.aspx</link><pubDate>Fri, 20 Feb 2009 03:29:56 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51034</guid><dc:creator>mash</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51034.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51034</wfw:commentRss><description>&lt;p&gt;Susan &amp;amp; Basil: Yes he&amp;#39;s using VBScript.&lt;/p&gt;&lt;p&gt;Susan chances are for ASP he&amp;#39;s using VBScript 5.5+ which has most of the basic regex features.&lt;/p&gt;&lt;p&gt;Gracias did you try use the pattern Susan suggested? Show your code with her pattern and explain what you value you are testing with and what result you are getting.&amp;nbsp; Keep in mind we can&amp;#39;t see what you are doing say there was a error really doesn&amp;#39;t tell us anything. The pattern shouldn&amp;#39;t throw an error.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Another question are you testing this client-side with Internet Explorer?&amp;nbsp; There is a bug in that browser dealing with look-aheads. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/51028.aspx</link><pubDate>Fri, 20 Feb 2009 02:37:53 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51028</guid><dc:creator>gracias86</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51028.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51028</wfw:commentRss><description>&lt;p&gt;Hi Basil and Aussie Susan, thanks for replying.&lt;/p&gt;&lt;p&gt;Sorry for late replies, i&amp;#39;m using VB script for this validation purpose. But due to the error with&amp;nbsp; the digit, i might use javascript (is it possible to do javascript and vb at the same time like in one asp page?) I try put (?=.*\d)&amp;nbsp; in the front, middle, and last and all of it not working properly. The validation for some strange reason keep making it error. Ah ya strange occurance is the [5,7] --&amp;gt; this strangely make the characters between 6 and 8.&amp;nbsp; not between 5 and 7. is it counting the white space also? this one really made me stuck around 2 days.. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/51025.aspx</link><pubDate>Fri, 20 Feb 2009 00:30:53 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51025</guid><dc:creator>Aussie Susan</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51025.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51025</wfw:commentRss><description>&lt;p&gt;Basil,&lt;/p&gt;&lt;p&gt;That was my first guess as well, but VB.Net would use the &amp;quot;Regex&amp;quot; class, not &amp;quot;Regexp&amp;quot; if I remember correctly. The quick search I did on the Internet showed the &amp;quot;new Regexp&amp;quot; occurred in JavaScript and so that was the reason for my guess.&lt;/p&gt;&lt;p&gt;Just re-enforces why the posting guidelines are there to be read - takes a lot of the guess work out of the situation and speeds up arriving at a suitable answer for the questioners.&lt;/p&gt;&lt;p&gt;Susan&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Edit: Just done some more searching of the net and I see that VBScript (as opposed to VB.Net - my mistake) uses the same regex engine as Javascript and both have the &amp;quot;RegExp&amp;quot; class. However, the site I looked at (http://www.regular-expressions.info/vbscript.html) also said that VBScript RegExp V1.0 does not support lazy quantifiers. If the error relates to their use, then try using using the &amp;#39;&amp;#39;normal&amp;#39; version of the quantifier instead.&lt;/p&gt;</description></item><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/51023.aspx</link><pubDate>Fri, 20 Feb 2009 00:06:23 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51023</guid><dc:creator>Basil</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51023.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51023</wfw:commentRss><description>&lt;p&gt;That&amp;#39;s definitely not javascript. I think it&amp;#39;s VB..script.. maybe..&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;The pattern should match though, and IgnoreCase should be true.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/51020.aspx</link><pubDate>Thu, 19 Feb 2009 22:30:23 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51020</guid><dc:creator>Aussie Susan</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51020.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51020</wfw:commentRss><description>&lt;p&gt;Please answer the questions I asked before. I&amp;#39;m guessing that you are using JavaScript. However you have not said what IS happening when you use the pattern I suggested: does it give a syntax error, a runtime error, no match at all, only a partial match......... Also, can you show us how you have tried to add in the &amp;#39;(?=.*\d)&amp;#39; to your pattern.&lt;/p&gt;&lt;p&gt;I tried my expression and various &amp;#39;good&amp;#39; and &amp;#39;bad&amp;#39; example strings using the Javascript regex tester at&amp;nbsp;http://www.regular-expressions.info/javascriptexample.html and my pattern worked as expected.&lt;/p&gt;&lt;p&gt;One thing you could try is to make sure you are not getting extraneous characters into your &amp;#39;strPassword&amp;#39; value. On some platforms, the end of the line is marked by the &amp;quot;\r\n&amp;quot; combination where the &amp;quot;\r&amp;quot; gets in the way of identifying the end of the string. (You can test this by making the last part of the pattern &amp;#39;\r?$&amp;quot;). However, this assumes that you are carrying the line terminators in the string variable and not trimming them.&lt;/p&gt;&lt;p&gt;Susan&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/51014.aspx</link><pubDate>Thu, 19 Feb 2009 12:54:27 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51014</guid><dc:creator>gracias86</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51014.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51014</wfw:commentRss><description>&lt;p&gt;Hi Aussie Susan, thanks for helping me, however, it still does not validate correctly. &lt;/p&gt;&lt;p&gt;for some unknown reason, anytime i put(?=.*\d), the password keep validating wrong, i try putting abc123 or abcde1 which supposed to work but it doesnt.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I&amp;#39;ll add the full code in the function:&amp;nbsp;&lt;/p&gt;Function ValidatePassword(strPassword)&lt;br /&gt;&amp;nbsp; Dim re&lt;br /&gt;&amp;nbsp; Set re = new RegExp&lt;br /&gt;&lt;br /&gt;&amp;nbsp; re.IgnoreCase = false&lt;br /&gt;&amp;nbsp; re.global = false&lt;br /&gt;&amp;nbsp; re.Pattern = &amp;quot;^[a-z]\w{5,7}$&amp;quot;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;ValidatePassword = re.Test(strPassword)&lt;br /&gt;End Function&lt;p&gt;&amp;nbsp;Any help will be gladly appreciated, thanks.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: RegEx for Validating Password</title><link>http://regexadvice.com/forums/thread/51013.aspx</link><pubDate>Thu, 19 Feb 2009 10:53:17 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51013</guid><dc:creator>Aussie Susan</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51013.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51013</wfw:commentRss><description>&lt;p&gt;Can you please provide us with the&amp;nbsp;information&amp;nbsp;requested in the sticky note at the top of this forum. In particular, we need to know the regex you are using&amp;nbsp;because&amp;nbsp;the following suggestion will only work with a regex that supports lookahead (from your attempt it looks like it does).&lt;/p&gt;&lt;p&gt;Also, have you searched through this forum for an answer? This type of&amp;nbsp;question&amp;nbsp;comes up fairly regularly and the existing responses often come with explanations of how they work and how they can be extended.&lt;/p&gt;&lt;p&gt;However, try:&lt;/p&gt;&lt;p&gt;^(?=.*?\d)[a-z][a-z0-9]{5,7}$&amp;nbsp;&lt;/p&gt;&lt;p&gt;with the &amp;#39;ignore case&amp;#39; option set. So you were fairly close - it would have helped if we had seen some of your attempts and how they didn&amp;#39;t match your test examples (error messages, matches that were wrong etc). (Note - &amp;#39;\w&amp;#39; includes the underscore character&amp;nbsp;which presumably would count as a special character for you)&lt;/p&gt;&lt;p&gt;Susan&amp;nbsp;&lt;/p&gt;</description></item><item><title>RegEx for Validating Password (ASP)</title><link>http://regexadvice.com/forums/thread/51012.aspx</link><pubDate>Thu, 19 Feb 2009 06:59:31 GMT</pubDate><guid isPermaLink="false">d291b357-6366-4006-9008-4266c301325a:51012</guid><dc:creator>gracias86</dc:creator><slash:comments>0</slash:comments><comments>http://regexadvice.com/forums/thread/51012.aspx</comments><wfw:commentRss>http://regexadvice.com/forums/commentrss.aspx?SectionID=68&amp;PostID=51012</wfw:commentRss><description>&lt;p&gt;Hi all, i need help with regular expression.&lt;/p&gt;&lt;p&gt;&amp;nbsp;It needs to start with a letter (therefore cant be start with digit), at least 6 chars, max 8. No special chars, only number and letter and had to AT LEAST contain 1 digit.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;this is what i have so far: re.Pattern = &amp;quot;^[a-z]\w{5,7}$&amp;quot;&lt;/p&gt;&lt;p&gt;Looks fine but i cant check if it at least contain 1 Digit. i cant fit this expression : (?=.*\d) into the regex above (had tried many ways) to check at least 1 digit occurs. Any advice, help or suggestion will be gladly appreciated. Thanks in advance.&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>