Loading ...
Sorry, an error occurred while loading the content.

RE: [jasspa] RegExp Question

Expand Messages
  • Phillips, Steven
    In macros I recommend the use of command search-buffer rather than search-forward or search-backward as you can explicitly specify whether magic or exact mode
    Message 1 of 6 , Sep 15, 2005
    • 0 Attachment
      In macros I recommend the use of command search-buffer rather than
      search-forward or search-backward as you can explicitly specify whether
      magic or exact mode are to be used. It's a lot easier than
      setting/resetting the modes and more reliable than not bothering to set
      them.

      The command was introduced in the last release to address this problem.

      Steve

      > -----Original Message-----
      > From: jasspa@yahoogroups.com [mailto:jasspa@yahoogroups.com] On Behalf
      Of
      > Jon Green
      > Sent: Friday, September 16, 2005 12:18 AM
      > To: jasspa@yahoogroups.com
      > Subject: Re: [jasspa] RegExp Question
      >
      > Gadrin wrote:
      > > Is this even possible ?
      > >
      > > given the following buffer:
      > >
      > > With qdfBestSellers
      > > .Connect = "ODBC;DATABASE=pubs;UID=sa;PWD=;" & _
      > > "DSN=Publishers"
      > > .SQL = "SELECT title, title_id FROM titles " & _
      > > "ORDER BY ytd_sales DESC"
      > > Set rstTopSeller = .OpenRecordset()
      > > rstTopSeller.MoveFirst
      > > End With
      > >
      > > I'd like to match the "words"
      > >
      > > .Connect
      > > .SQL
      > > .OpenRecordset()
      > >
      > > but can't seem to using "\b\\." which I assume is due to the fact
      > > that the period character isn't considered a word character, so "\<"
      > > won't help either.
      > >
      > > It's quite possible that there won't be a space in front of the
      > > period in further tests, so I'd rather not use "\ \\." either.
      > >
      > > anybody have an ideas ?
      > >
      >
      > You need MAGIC mode on.
      > Search for the regular expression
      >
      > "\.\(Connect\|SQL\|OpenRecordSet()\)"
      >
      > If you turn EXACT mode off you could search for
      >
      > "\.\(connect\|sql\|openrecordset()\)"
      >
      > If you wanted to search for all "." words you could use:
      >
      > "\.\w+"
      >
      > Capitalised words:
      >
      > "\.\u\w+
      >
      > With no leading word character (i.e. white space only)
      >
      > "\B\.\w+"
      >
      > For command line then use one slash, for macros then use 2 slashes.
      > For help look at the regularExpressions(2) manual page.
      >
      > Regards
      > Jon.
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      >
      ________________________________________________________________________
      __
      >
      > This is an unmoderated list. JASSPA is not responsible for the content
      of
      > any material posted to this list.
      >
      > To unsubscribe, send a mail message to
      >
      > mailto:jasspa-unsubscribe@yahoogroups.com
      >
      > or visit http://groups.yahoo.com/group/jasspa and
      > modify your account settings manually.
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.