I, for one, am having trouble understanding what you're trying to
accomplish.  I could probably help you if I understood the purpose/goal of
your regular expression.

Assuming that you have this content loaded into a variable, you're not
reading a line at a time from a file, and you're wanting to find new lines
and leading white-space I'd search like this (also matches white-space at
the beginning and end of the file and at the end of a line):
((^|\s*[\r\n]+)\s|\s+$)

Disclaimer: I haven't tested the regex, but it should work as advertised.

On Thu, Jul 17, 2008 at 11:18 AM, Will Tomlinson <[EMAIL PROTECTED]>
wrote:

> Let's say I've got a chunk of source code like so:
>
>
> <form name="frmLogin" action="index.cfm?action=tomlinson.setTestForm"
> method="post">
>  <table width="45%" align="left" border="0" cellpadding="5" cellspacing="1"
> class="subHeader">
>   <tr valign="middle" bgcolor="ffffff">
>    <td width="20%" align="right">Username</td>
>    <td width="20%" align="left"><input class="req" type="text" name="usrID"
> size="20" value="#variables.frmData.usrID#" /></td>
>   </tr>
>
> etc...
>
> So it can have almost any kind of character in it.
>
> Now, let's say I want to check the beginning for whatever, in this case, I
> want a match if it has a newline or carriage return at the beginning.
>
> (?i)^[\r\s]+[.\r\s\S]*
>
> With this regex i'm trying to say, look for the newline/tab/c.return at the
> start of the text, and allow ANYthing afterwards. I don't care what comes
> after, allow it.
>
> My problem is understanding the \S (non whitespace) in the 2nd []. If I
> remove it, I don't have a match. if I include it,I DO have a match. What is
> in that chunk of text that isn't being matched, that .\r\s won't match.
>
> What's the best way to say look, I don't care what comes AFTER this
> specific piece of the regex that matches. Allow EVERYthing.
>
> Make sense?
>
> Thanks,
> Will
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309239
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to