Ruby 1.8.6 with Oniguruama installed and working (everywhere else, this
seems to be my problem).
Let me preface this by saying that I am new to Ruby (and kinda jumped
in, rather than learning it properly), and regexes are not my thing -
that why I have nifty regex-checkers.
I am trying to extract some parts out of a string
("<p><b>'Algebra'</b><br>") that I scraped from some html. I'm getting
nil returned from the expression:
with scraped_html being the string mentioned above.
Doing some experimenting, I have found that the first part works just as
planned (eg, everything except the lookahead). Using wildcards (. and
*) works as well:
Ruby 1.8.6 with Oniguruama installed and working (everywhere else, this
seems to be my problem).
Let me preface this by saying that I am new to Ruby (and kinda jumped
in, rather than learning it properly), and regexes are not my thing -
that why I have nifty regex-checkers.
I am trying to extract some parts out of a string
("<p><b>'Algebra'</b><br>") that I scraped from some html. I'm getting
nil returned from the expression:
with scraped_html being the string mentioned above.
Doing some experimenting, I have found that the first part works just as
planned (eg, everything except the lookahead). Using wildcards (. and
*) works as well:
I.e. use groups to extract the part that I am interested in.
Kind regards
robert
Ah, thank you very much. My regex learning was with PHP (PCRE, not
POSIX), which has some odd rules, especially regarding
greedy/non-greedy, so I'm still trying to recover from that.