Re: how do I extract the ID name of a Div and its content?



Hans Wurst wrote:
but I tried for 3hours and don`t know how :-(

So, what approach or approaches did you try? What was the solution that
got closest to what you were trying, and what did it output?

There are a whole host of ways you might be approaching this. For
example, you might be using the Hpricot (HTML parsing) library, or REXML
(XML parsing), or simple regular expression matching.

If all you want is the bits between 'single quotes' then a regular
expression match is probably easiest. Try using String#scan, and give it
a regular expression which matches a single quote followed by any number
of non-single-quote characters followed by a single quote.

Or you could use use String#split("'") and keep only the odd-numbered
elements of the returned array.

I'm sure if you post your actual code and what it does, someone will
help you tweak it to work.
--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages

  • Re: RegularExpression Validation for password in ASP.NET
    ... Can any one help me to write a regular expression to validate the password ... 3- Password must begin with an alphabetic character. ... single quote, double quotes, comma). ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: RegularExpression Validation for password in ASP.NET
    ... Can any one help me to write a regular expression to validate the ... 3- Password must begin with an alphabetic character. ... single quote, double quotes, comma). ...
    (microsoft.public.dotnet.framework.aspnet)
  • RegularExpression Validation for password in ASP.NET
    ... Can any one help me to write a regular expression to validate the password ... 3- Password must begin with an alphabetic character. ... single quote, double quotes, comma). ...
    (microsoft.public.dotnet.framework.aspnet)
  • Regular expression problem
    ... I am trying to come up with a regular expression that searches and ... replaces all occurences of the string "'" and replaces it with "''". ... However if a backslash comes before the single quote I do NOT want it ...
    (comp.lang.java)