The [brackets] around \s and " are unnecessary.  \s is a character class 
shortcut, so you don't need the brackets.  A character class of only one 
character is that character, so ["] is the same as ".  The construct 
(["])(.*?)\2 is kind of silly, and could be replace more efficiently 
with ".*?" (which will run faster and more efficiently).

But, like I said in another post, the simplest (and most efficient, 
really) regex for input tags is going to be <input.*?>.

--Ben Doom

Larry Lyons wrote:
> Forgot to add this  is what I used to extract the input form fields:
> 
> '<input[^>]*?name[/s]*=[/s]*(["])(.*?)\2[^>]*?>'
> 
> larry
> 
>>> 'name="[^"]"' or 'name=".*?"' -- either should work.
>>>
>>> --Ben Doom
>>>
>> Thanks for you help Ben.
>>
>> Unfortunately both just return a 1 - the starting position of name=".
>>
>> So here's what I ended up doing - its a kludge but it works for now. I 
>> hope to refine it later. First to extract the <input... strings from 
>> each of the forms, I used a set of regex UDF's by Steven Levithan,
>> http://blog.stevenlevithan.com/archives/rematch-coldfusion 
>>
>> That returns an array of structs consisting of the starting position 
>> of the search string, the length and the value.
>> I then loop over the array and extract the name="..." strings using a 
>> find to get the position and length of the name attribute's value. 
>> Then its a matter of using mid() to extract the name.
>>
>> regards,
>>
>> larry 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: http://www.houseoffusion.com/groups/RegEx/message.cfm/messageid:1099
Subscription: http://www.houseoffusion.com/groups/RegEx/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21

Reply via email to