help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string searching and saving results to a variable


From: ken
Subject: Re: string searching and saving results to a variable
Date: Fri, 18 Feb 2011 12:33:47 -0500
User-agent: Thunderbird 2.0.0.24 (X11/20101213)

On 02/17/2011 08:30 AM Perry Smith wrote:
> On Feb 17, 2011, at 4:51 AM, ken wrote:
> 
>> On 02/15/2011 06:33 PM Perry Smith wrote:
>>> On Feb 15, 2011, at 5:15 PM, ken wrote:
>>>
>>>> ....
>>>>
>>>> <h3>Section 4</h3>
>>>>
>>>> but it could be multiple lines like this
>>>>
>>>> <h3 class="newest-chapter-section-type" align="center">On
>>>> the origins of elisp confusion</h3>
>>>>
>>>> It could even be three or four lines long.  Also, the line(s) could be
>>>> indented and so have unwanted white space in the first several columns.
>>>>
>>>> ....
>> Thanks, Perry.  That got me through that step.
>>
>> Next little thing: I want to check if the initial heading tag might
>> *already* contain the "name" attribute.  So with the point at the start
>> of that tag, I'd do something like this:
>>
>> (re-search-forward
>> "name=\"\\|name[whitespace]=\"\\|name[whitespace]=[whitespace]\""
>> end-heading nil nil)
>>
>> Is there a shortcut way in elisp to express any and all combinations of
>> whitespace...?  if not, how to do this?
> 
> The answer to your question appears to be `\s ' is for any whitespace
> character.  (backslash s space) But let me try to teach you how to fish.

Thanks again.


> 
> In emacs, do C-h i to get into "Info".  ....

I've known about "info" for a couple decades and use it (from within a
terminal window mostly) on occasion (and for more than just emacs), but
I've found over the years that it doesn't often give me the answer I
need.  In particular, it doesn't contain a lot of working examples...
these are much more helpful in learning and more prevalent on the web.
So I'm more likely to go to the web... which is what I did.  I guess in
this instance I should have gone to "info" first.

Let me make a disclaimer.  I'm figuring out as much of the coding as I
can on my own... and this before I come to this list.  It's only when I
search for an answer for a couple hours and get nowhere that I figure
it's time to ask the pros.  I mean isn't this a major reason for the
existence of this list?  The other thing is that I don't have a lot of
spare time for coding like this.  (I originally thought I might be able
to code this whole routine and start using it the same day.  Well, it's
been a good part of several days I've been on it now.  But I'm learning
a little more elisp, so that's okay... probably.)  And I try to post
questions which aren't going to require someone to either read or write
a lot.  And I'm not asking anyone to write the entire routine for me.
I'm kind of surprised that with all the people on this list, just one
person is providing any answers.  Maybe I'm on the wrong list (?).


> One reply to your question asked which mode you are in.  A good mode will
> understand the html far better than your searches.

I'm using html-helper-mode.  I've looked through a lot of the code (but,
yeah, not all of it) over the years and while the functions are pretty
basic in terms of functionality (more so than what I'm writing), the
code is not completely transparent.  I've tweaked a lot of it in trivial
ways, grepped it looking for stuff, but I'm not thinking it would be
terribly useful to read through the entirety of it.


> 
> HTH,
> Perry

Yeah, it did help.  Thanks again,
ken




reply via email to

[Prev in Thread] Current Thread [Next in Thread]