unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Perry Smith <pedzsan@gmail.com>
To: gebser@mousecar.com
Cc: GNU Emacs List <help-gnu-emacs@gnu.org>
Subject: Re: string searching and saving results to a variable
Date: Thu, 17 Feb 2011 07:30:19 -0600	[thread overview]
Message-ID: <9889F717-9CDF-4E15-92AC-5E9D94C3E93D@gmail.com> (raw)
In-Reply-To: <4D5CFDCA.3040705@mousecar.com>


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.

In emacs, do C-h i to get into "Info".  On some systems, that will not work
at all and thats bad.  On other systems, it will put you into a larger directory
of "Info" topics.  Search down and pick "Emacs".  C-h m will tell you something
about the Info mode that you are in to teach you how to work within
info.  On other systems, the initial C-h i puts you into the Emacs info (like
on my Mac).

Once you get into Info and get into the Emacs node, look for Regular and you
will see at least three topics.  One is Regexp Backslash.  That has the
info I just found for your.

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

HTH,
Perry




  reply	other threads:[~2011-02-17 13:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 23:15 string searching and saving results to a variable ken
2011-02-15 23:33 ` Perry Smith
2011-02-16  6:55   ` ken
2011-02-16  9:21     ` Oleksandr Gavenko
2011-02-16 16:58       ` ken
2011-02-19 11:16         ` Oleksandr Gavenko
2011-02-16 11:28     ` Le Wang
2011-02-17 10:51   ` ken
2011-02-17 13:30     ` Perry Smith [this message]
2011-02-18 17:33       ` ken
2011-02-18 18:16         ` Le Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9889F717-9CDF-4E15-92AC-5E9D94C3E93D@gmail.com \
    --to=pedzsan@gmail.com \
    --cc=gebser@mousecar.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).