1. wildcard_match; Return position

Hey,

Do anyone know of a wildcard_match version that returns the position id for the
first occurance of the search?

The one that is included in the standard euphoria archives do only return true
or false, or rather one and zero.

Regards,
Kenneth 'ZNorQ' Nilsson

new topic     » topic index » view message » categorize

2. Re: wildcard_match; Return position

ZNorQ wrote:
> 
> Hey,
> 
> Do anyone know of a wildcard_match version that returns the position id for
> the first occurance of the search?
> 
> The one that is included in the standard euphoria archives do only return true
> or false, or rather one and zero.

It's a bit heavy handed if you're not already using it, but wxEuphoria
has regular expression support now.

Matt

new topic     » goto parent     » topic index » view message » categorize

3. Re: wildcard_match; Return position

ZNorQ wrote:
> 
> Hey,
> 
> Do anyone know of a wildcard_match version that returns the position id for
> the first occurance of the search?
> 
> The one that is included in the standard euphoria archives do only return true
> or false, or rather one and zero.
> 
> Regards,
> Kenneth 'ZNorQ' Nilsson

You can try EuRegExp in the archive, it will give you this sort of info and
more. It's an Euphoria-oriented regular expression library, mostly compatible
with Perl's conventions.

CChris

new topic     » goto parent     » topic index » view message » categorize

4. Re: wildcard_match; Return position

Matt Lewis wrote:
> 
> ZNorQ wrote:
> > 
> > Hey,
> > 
> > Do anyone know of a wildcard_match version that returns the position id for
> > the first occurance of the search?
> > 
> > The one that is included in the standard euphoria archives do only return
> > true
> > or false, or rather one and zero.
> 
> It's a bit heavy handed if you're not already using it, but wxEuphoria
> has regular expression support now.
> 
> Matt

Hey Matt,

Ok, I'll have a look into that. I'm not quite fluid in reg.exp. use, and I quite
urgenty need the updated version of wildcard_match, but seeing that I have no
choice, I better get up to speed asap! :)

Thanks, Matt.

new topic     » goto parent     » topic index » view message » categorize

5. Re: wildcard_match; Return position

CChris wrote:
> 
> ZNorQ wrote:
> > 
> > Hey,
> > 
> > Do anyone know of a wildcard_match version that returns the position id for
> > the first occurance of the search?
> > 
> > The one that is included in the standard euphoria archives do only return
> > true
> > or false, or rather one and zero.
> > 
> > Regards,
> > Kenneth 'ZNorQ' Nilsson
> 
> You can try EuRegExp in the archive, it will give you this sort of info and
> more. It's an Euphoria-oriented regular expression library, mostly compatible
> with Perl's conventions.
> 
> CChris

Ok, I'll check this out. As I told Matt, I'm not quite the wizz-kid in reg.exp.,
but this'll be as good as any time to learn it.

Thanks to you both.

Kenneth / ZNorQ

new topic     » goto parent     » topic index » view message » categorize

6. Re: wildcard_match; Return position

CChris wrote:
> 
> ZNorQ wrote:
> > 
> > Hey,
> > 
> > Do anyone know of a wildcard_match version that returns the position id for
> > the first occurance of the search?
> > 
> > The one that is included in the standard euphoria archives do only return
> > true
> > or false, or rather one and zero.
> > 
> > Regards,
> > Kenneth 'ZNorQ' Nilsson
> 
> You can try EuRegExp in the archive, it will give you this sort of info and
> more. It's an Euphoria-oriented regular expression library, mostly compatible
> with Perl's conventions.
> 
> CChris

Hmm. As soon as I include it, I first get an error saying that EuRegExp.e has an
error at line 443 - w has not been declared.

So I added w to the sequence a few lines above, and tried again - but this time
I got a new error;

EuRegExp.e @ line 913; search_again takes 4 arguments 
  else option-=8 z=search_again(s0,s1,options)
                                             ^

Is it me, or what?
(Keep in mind, I haven't gotten around to use any of the code yet - it's just
included!)

Kenneth / ZNorQ

new topic     » goto parent     » topic index » view message » categorize

7. Re: wildcard_match; Return position

ZNorQ wrote:
> 
> CChris wrote:
> > 
> > ZNorQ wrote:
> > > 
> > > Hey,
> > > 
> > > Do anyone know of a wildcard_match version that returns the position id
> > > for
> > > the first occurance of the search?
> > > 
> > > The one that is included in the standard euphoria archives do only return
> > > true
> > > or false, or rather one and zero.
> > > 
> > > Regards,
> > > Kenneth 'ZNorQ' Nilsson
> > 
> > You can try EuRegExp in the archive, it will give you this sort of info and
> > more. It's an Euphoria-oriented regular expression library, mostly
> > compatible
> > with Perl's conventions.
> > 
> > CChris
> 
> Hmm. As soon as I include it, I first get an error saying that EuRegExp.e has
> an error at line 443 - w has not been declared.
> 
> So I added w to the sequence a few lines above, and tried again - but this
> time
> I got a new error;
> 
> EuRegExp.e @ line 913; search_again takes 4 arguments 
>   else option-=8 z=search_again(s0,s1,options)
>                                              ^
> 
> Is it me, or what?
> (Keep in mind, I haven't gotten around to use any of the code yet - it's just
> included!)
> 
> Kenneth / ZNorQ

Sorry, I didn't check last night, but I will tonight. I haven't touched this
code for years...

CChris

new topic     » goto parent     » topic index » view message » categorize

8. Re: wildcard_match; Return position

> Sorry, I didn't check last night, but I will tonight. I haven't touched this
> code for years...
>
> CChris

Rgr, thanks.

However, I did solve the problem at hand, so the use of the archive isn't that
urgent anymore. However, it would be nice to have these features ready for future
use.

Kenneth / ZNorQ

new topic     » goto parent     » topic index » view message » categorize

9. Re: wildcard_match; Return position

ZNorQ wrote:
> 
> > Sorry, I didn't check last night, but I will tonight. I haven't touched this
> > code for years...
> >
> > CChris
> 
> Rgr, thanks.
> 
> However, I did solve the problem at hand, so the use of the archive isn't that
> urgent anymore. However, it would be nice to have these features ready for
> future
> use.
> 
> Kenneth / ZNorQ

I just wrote this in test.exw:
include euregexp.e
pretty_print(1,reg_search("[!d-i](2,4)","The quick brown fox",0),{2})
?machine_func(26,0)


and it printed, as expected:

{
  4,
  {1,4},
  "The",
  {
    {
      " q",
      "uick brown fox"
    },
    {
      " qu",
      "ick brown fox"
    }
  },
  {
    " quick brown fox",
    {
      {
        0,
        2,
        4,
        1,
        {
          " c",
          {106'j',255}
        }
      }
    }
  }
}

which is all explained in the docs.
Does the above work for you?
If so, could I see your code one way or another?
My actual email is oedoc hat free doubt fr

CChris

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu