Regex: copy with ignoreCase

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Regex: copy with ignoreCase

Herby Vojčík
Hi!

String >> #asRegex return an instance of RxMatcher, as I tried. Now, I
would like to get an object that behaves exactly as the one I got from
asRegex, just that it ignores case (regardless whether it did or didn't
in the original object).

I understand it is not possible to get that object with existing API, is it?

Herby

Reply | Threaded
Open this post in threaded view
|

Re: Regex: copy with ignoreCase

Julien Delplanque-2
Hello,

Maybe what you’re looking for is String>>#asRegexIgnoringCase ?

'a+' asRegexIgnoringCase matches: 'aaaa'. "true"
'a+' asRegexIgnoringCase matches: 'AAAA'. "true"

Cheers,

Julien

---
Julien Delplanque
Doctorant à l’Université de Lille 1
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Numéro de téléphone: +333 59 35 86 40

Le 29 janv. 2018 à 23:11, Herbert Vojčík <[hidden email]> a écrit :

Hi!

String >> #asRegex return an instance of RxMatcher, as I tried. Now, I would like to get an object that behaves exactly as the one I got from asRegex, just that it ignores case (regardless whether it did or didn't in the original object).

I understand it is not possible to get that object with existing API, is it?

Herby


Reply | Threaded
Open this post in threaded view
|

Re: Regex: copy with ignoreCase

Herby Vojčík


Julien wrote:
> Hello,
>
> Maybe what you’re looking for is String>>#asRegexIgnoringCase ?

No, I am looking at what I described (#copyWithIgnoreCase).

> 'a+' asRegexIgnoringCase matches: 'aaaa'. "true"
> 'a+' asRegexIgnoringCase matches: 'AAAA'. "true"
>
> Cheers,
>
> Julien
>
> ---
> Julien Delplanque
> Doctorant à l’Université de Lille 1
> http://juliendelplanque.be/phd.html
> Equipe Rmod, Inria
> Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
> Numéro de téléphone: +333 59 35 86 40
>
>> Le 29 janv. 2018 à 23:11, Herbert Vojčík <[hidden email]
>> <mailto:[hidden email]>> a écrit :
>>
>> Hi!
>>
>> String >> #asRegex return an instance of RxMatcher, as I tried. Now,
>> I would like to get an object that behaves exactly as the one I got
>> from asRegex, just that it ignores case (regardless whether it did or
>> didn't in the original object).
>>
>> I understand it is not possible to get that object with existing API,
>> is it?
>>
>> Herby
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Regex: copy with ignoreCase

Julien Delplanque-2
I think there is not such method then.

Maybe it is possible to transform the RxMatcher to ignore case but it is not available out of the box apparently.

The #ignoreCase inst. var. provides no accessor, so it I think just modifying it to be true will not work.

Julien

---
Julien Delplanque
Doctorant à l’Université de Lille 1
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Numéro de téléphone: +333 59 35 86 40

Le 29 janv. 2018 à 23:41, Herbert Vojčík <[hidden email]> a écrit :



Julien wrote:
Hello,

Maybe what you’re looking for is String>>#asRegexIgnoringCase ?

No, I am looking at what I described (#copyWithIgnoreCase).

'a+' asRegexIgnoringCase matches: 'aaaa'. "true"
'a+' asRegexIgnoringCase matches: 'AAAA'. "true"

Cheers,

Julien

---
Julien Delplanque
Doctorant à l’Université de Lille 1
http://juliendelplanque.be/phd.html
Equipe Rmod, Inria
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Numéro de téléphone: +333 59 35 86 40

Le 29 janv. 2018 à 23:11, Herbert Vojčík <[hidden email] <[hidden email]>> a écrit :

Hi!

String >> #asRegex return an instance of RxMatcher, as I tried. Now, I would like to get an object that behaves exactly as the one I got from asRegex, just that it ignores case (regardless whether it did or didn't in the original object).

I understand it is not possible to get that object with existing API, is it?

Herby