I have a string
When i use the Regulator to create a regex it matches. my sample is
“http(.)+[”]
It returns
“StockCharts.com”>
However when i use ruby, it returns
When i use ruby with syntax a.scan(/“http(.)+[”]/)
It returns [[“t”]]
can someone help determine what error i am doing
Hi –
On Mon, 7 Aug 2006, [email protected] wrote:
It returns [[“t”]]
can someone help determine what error i am doing
When you use parenthetical captures, String#scan returns successive
arrays of those captures. In the case of your scan, you’ve matched
the string once, and captured “t” in the first () group.
If you want a substring that starts with "http and ends with ", you
can do:
a[/“http[^”]+"/]
David