[Ruby] regex question

shaners becker veganstraightedge at gmail.com
Mon Feb 12 17:30:50 PST 2007


closer.

that found a result. but only one result. it found from the first  
<recommendation> all the way through the last </recommendation>  
ignoring all the rest along the way

the document is structured like so:

book --1
	recommendation  --1
		book  --1a
		book  --1b
		book  --1c
	/recommendation  --1
/book --1
book --2
	recommendation  --2
		book  --2a
		book  --2b
		book  --2c
	/recommendation  --2
/book --2

and so on.

> <recommendations>(?m).*</recommendations>

finds from recommendation  --1 all the way to /recommendation --2  
leaving only one book with no recommendations. instead of two books  
with no recommendations.

-sb


On Feb 12, 2007, at 5:16 PM, Frederick Alger wrote:

>> I'm not sure how you'd do that in textmate....
>
> According to the TextMate manual, you can add a multiline flag to the
> regex as so:
>
> <recommendations>(?m).*</recommendations>
>
> - Fred.
> _______________________________________________
> Ruby at zenspider.com - Seattle.rb non-commercial list
> http://www.zenspider.com/seattle.rb
> http://www.zenspider.com/mailman/listinfo/ruby




-----------
join the resistance. fall in love.
http://theresistancearmy.com/




More information about the Ruby mailing list