# Help with regex needed

**URL:** <https://www.ruby-forum.com/t/help-with-regex-needed/151490>\
**Category:** Rails\
**Created:** [October 22, 2008, 6:58am UTC](https://www.ruby-forum.com/t/help-with-regex-needed/151490 "2008-10-22T06:58:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@kim](https://www.ruby-forum.com/u/kim)\
**Post date:** [October 22, 2008, 6:58am UTC](https://www.ruby-forum.com/t/help-with-regex-needed/151490/1 "2008-10-22T06:58:51Z")

</div>

Here is the array I am scanning:  
["\n

&nbsp;\<a href="/search~S13?/rWR%20121/rwr+121/1,7,9,B/  
frameset~2489041&FF=rwr+121&1,1,"\>The Academic Writer: A Brief Guide\</  
a\>\n\n\n&nbsp;Ede, Lisa\n\n\n\n&nbsp;Valley  
Reserves – VR 282 – AVAILABLE\n\n\n\n&nbsp;\n\n\n\</  
tr\>\n\n&nbsp;\<a href="/search~S13?/rWR%20121/rwr+121/1,7,9,B/  
frameset~1334646&FF=rwr+121&1,1,"\>Cultural literacy : what every  
American needs to know / E.D. Hirsch, Jr. ; with an appendix, What li\</  
a\>\n\n\n&nbsp;Hirsch, E. D. (Eric Donald), 1928-\n\n  
\n\n&nbsp;Valley Reserves – LC149 .H57 1987 – AVAILABLE\n  
\n\n\n&nbsp;\n]

I am trying to get the values (all but newlines and such) out from in  
between the

Tried this :  
s.first.scan(/\<td \>(.\*?)\</td\>/mi)  
But I never get the first

 a href values.

Any help is appreciated. Thanks. Kim

---

<div class="post-metadata">

**Author:** ![kim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@kim](https://www.ruby-forum.com/u/kim)\
**Post date:** [October 22, 2008, 7:19am UTC](https://www.ruby-forum.com/t/help-with-regex-needed/151490/2 "2008-10-22T07:19:56Z")

</div>

On Oct 22, 2008, at 12:38 AM, Kim wrote:

> a\>\n\n\n&nbsp;Hirsch, E. D. (Eric Donald), 1928-\n\n  
> Any help is appreciated. Thanks. Kim  
> because the first is not a of course. Your regexp looks for:  
> /\<td \>  
> ^  
> Did you mean something like %r{\<td\b[^\>]_\>(._?)}mi

Note that %r{} for a regexp literal can be more convenient when you  
hope to match a slash.

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
