Lasso 8.5 and 8.6 RegEx Module

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Lasso 8.5 and 8.6 RegEx Module

Lasso Talk
Hi all,

Does anyone know what RegEx module is used in Lasso Lasso 8.5 and 8.6? I
tried some RegEx tester and nearest is RegEx Coach. Unfortunately a lot
of terms that I use in JavaScript, PHP or C# do not work in Lasso.
Can you advice me an tool/software which is closest to the Lasso module
RegEx?

Thanks you for help

Regards

Lubos Voros
senior front-end developer


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso 8.5 and 8.6 RegEx Module

Bil Corry-3
It uses PCRE  If it isn't working for you, my guess is you're missing the
double backslashes.  Can you provide an example of something you've tried
that isn't working?


- Bil

On Sat, Apr 16, 2016 at 5:12 PM, Lassozone.com: LassoTalk <
[hidden email]> wrote:

> Hi all,
>
> Does anyone know what RegEx module is used in Lasso Lasso 8.5 and 8.6? I
> tried some RegEx tester and nearest is RegEx Coach. Unfortunately a lot of
> terms that I use in JavaScript, PHP or C# do not work in Lasso.
> Can you advice me an tool/software which is closest to the Lasso module
> RegEx?
>
> Thanks you for help
>
> Regards
>
> Lubos Voros
> senior front-end developer
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso 8.5 and 8.6 RegEx Module

Lasso Talk
Bill,
I use escape backslashes :-)

Example from RegEx Coach:

expression:
\[code\](.*)\[/code\]

replace string:
<pre><code>\1</code></pre>

text:
[code]; Melodie Box
;Große Oktave
.equ C0    = 38223
.equ Cdis0 = 36077
.equ D0    = 34053
.equ Ddis0 = 32141
.equ E0    = 30337
.equ F0    = 28635
.equ Fdis0 = 27027
.equ G0    = 25510
.equ Gdis0 = 24079
.equ A0    = 22727
.equ Adis0 = 21452
.equ H0    = 20248
[/code]

In Lasso I must use (I have all expressions in array with replace strings):
Only this working correctly.

'\\[code\]'='<pre><code>', // for [code] without option parameter

'\\[code=(.*?)\](.*?)'='<pre><codeclass="\\1"data-language="\\1">\\2',
// for [code] with option parameter

'\\[/code\]'='</code></pre>', // for [/code] close tag



but this example working correctly in one expression

'\\[right\](.*?)\\[/right\]'='<spanclass="right">\\1</span>'

[code] expression is same as [right] but not working me :-)
'\\[code\](.*?)\\[/code\]'='<pre><code>\\1</code></pre>',

Maybe is problem with multiline option ([code][/code] is long text), but this option I not find in Lasso docs.


I working on BBCode parser for Lasso.

Thanks

Lubos



> Bil Corry <mailto:[hidden email]>
> 16. apríla 2016 17:31
> It uses PCRE If it isn't working for you, my guess is you're missing the
> double backslashes. Can you provide an example of something you've tried
> that isn't working?
>
>
> - Bil
>
> On Sat, Apr 16, 2016 at 5:12 PM, Lassozone.com: LassoTalk <
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to <[hidden email]>
> Lassozone.com: LassoTalk <mailto:[hidden email]>
> 16. apríla 2016 17:12
> Hi all,
>
> Does anyone know what RegEx module is used in Lasso Lasso 8.5 and 8.6?
> I tried some RegEx tester and nearest is RegEx Coach. Unfortunately a
> lot of terms that I use in JavaScript, PHP or C# do not work in Lasso.
> Can you advice me an tool/software which is closest to the Lasso
> module RegEx?
>
> Thanks you for help
>
> Regards
>
> Lubos Voros
> senior front-end developer



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso 8.5 and 8.6 RegEx Module

Ke Carlton-3
As Bil mentioned; in Lasso 8.x you need to double escape all back slashes,
ie.

    \[code\](.*)\[/code\]

Becomes:

    \\[code\\](.*)\\[/code\\]

So the full regexp would be:

string_replaceregexp(
'Example [code]function(){}[/code]',
-find       = '\\[code\\](.*)\\[/code\\]',
-replace = '<pre><code>\\1</code></pre>'
)

In Lasso 9 you can use back ticks:

-find = `\[code\](.*)\[/code\]`

Which is much nicer.

Ke


On Sun, Apr 17, 2016 at 3:52 AM Lassozone.com: LassoTalk <
[hidden email]> wrote:

> Bill,
> I use escape backslashes :-)
>
> Example from RegEx Coach:
>
> expression:
> \[code\](.*)\[/code\]
>
> replace string:
> <pre><code>\1</code></pre>
>
> text:
> [code]; Melodie Box
> ;Große Oktave
> .equ C0    = 38223
> .equ Cdis0 = 36077
> .equ D0    = 34053
> .equ Ddis0 = 32141
> .equ E0    = 30337
> .equ F0    = 28635
> .equ Fdis0 = 27027
> .equ G0    = 25510
> .equ Gdis0 = 24079
> .equ A0    = 22727
> .equ Adis0 = 21452
> .equ H0    = 20248
> [/code]
>
> In Lasso I must use (I have all expressions in array with replace strings):
> Only this working correctly.
>
> '\\[code\]'='<pre><code>',      // for [code] without option parameter
>
> '\\[code=(.*?)\](.*?)'='<pre><codeclass="\\1"data-language="\\1">\\2',
> // for [code] with option parameter
>
> '\\[/code\]'='</code></pre>',   // for [/code] close tag
>
>
>
> but this example working correctly in one expression
>
> '\\[right\](.*?)\\[/right\]'='<spanclass="right">\\1</span>'
>
> [code] expression is same as [right] but not working me :-)
> '\\[code\](.*?)\\[/code\]'='<pre><code>\\1</code></pre>',
>
> Maybe is problem with multiline option ([code][/code] is long text), but
> this option I not find in Lasso docs.
>
>
> I working on BBCode parser for Lasso.
>
> Thanks
>
> Lubos
>
>
>
> > Bil Corry <mailto:[hidden email]>
> > 16. apríla 2016 17:31
> > It uses PCRE If it isn't working for you, my guess is you're missing the
> > double backslashes. Can you provide an example of something you've tried
> > that isn't working?
> >
> >
> > - Bil
> >
> > On Sat, Apr 16, 2016 at 5:12 PM, Lassozone.com: LassoTalk <
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> > the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to <[hidden email]>
> > Lassozone.com: LassoTalk <mailto:[hidden email]>
> > 16. apríla 2016 17:12
> > Hi all,
> >
> > Does anyone know what RegEx module is used in Lasso Lasso 8.5 and 8.6?
> > I tried some RegEx tester and nearest is RegEx Coach. Unfortunately a
> > lot of terms that I use in JavaScript, PHP or C# do not work in Lasso.
> > Can you advice me an tool/software which is closest to the Lasso
> > module RegEx?
> >
> > Thanks you for help
> >
> > Regards
> >
> > Lubos Voros
> > senior front-end developer
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso 8.5 and 8.6 RegEx Module

Bil Corry-3
I tried it and it seems you need to turn on multi-line mode.  I'm sure
there's a Lasso way to do it, but I don't recall, I always just used the
regex switch (?s) instead.  It works if you do that:

[

var('text') = '
some text

[code]; Melodie Box
;Große Oktave
.equ C0    = 38223
.equ Cdis0 = 36077
.equ D0    = 34053
.equ Ddis0 = 32141
.equ E0    = 30337
.equ F0    = 28635
.equ Fdis0 = 27027
.equ G0    = 25510
.equ Gdis0 = 24079
.equ A0    = 22727
.equ Adis0 = 21452
.equ H0    = 20248
[/code]

more text


';

var('out') =
string_replaceregexp($text,-find='(?is)\\[code\\](.*)\\[/code\\]',-replace='<pre><code>\\1</code></pre>');

$out;

]


- Bil


On Sun, Apr 17, 2016 at 1:25 AM, Ke Carlton <[hidden email]> wrote:

> As Bil mentioned; in Lasso 8.x you need to double escape all back slashes,
> ie.
>
>     \[code\](.*)\[/code\]
>
> Becomes:
>
>     \\[code\\](.*)\\[/code\\]
>
> So the full regexp would be:
>
> string_replaceregexp(
> 'Example [code]function(){}[/code]',
> -find       = '\\[code\\](.*)\\[/code\\]',
> -replace = '<pre><code>\\1</code></pre>'
> )
>
> In Lasso 9 you can use back ticks:
>
> -find = `\[code\](.*)\[/code\]`
>
> Which is much nicer.
>
> Ke
>
>
> On Sun, Apr 17, 2016 at 3:52 AM Lassozone.com: LassoTalk <
> [hidden email]> wrote:
>
> > Bill,
> > I use escape backslashes :-)
> >
> > Example from RegEx Coach:
> >
> > expression:
> > \[code\](.*)\[/code\]
> >
> > replace string:
> > <pre><code>\1</code></pre>
> >
> > text:
> > [code]; Melodie Box
> > ;Große Oktave
> > .equ C0    = 38223
> > .equ Cdis0 = 36077
> > .equ D0    = 34053
> > .equ Ddis0 = 32141
> > .equ E0    = 30337
> > .equ F0    = 28635
> > .equ Fdis0 = 27027
> > .equ G0    = 25510
> > .equ Gdis0 = 24079
> > .equ A0    = 22727
> > .equ Adis0 = 21452
> > .equ H0    = 20248
> > [/code]
> >
> > In Lasso I must use (I have all expressions in array with replace
> strings):
> > Only this working correctly.
> >
> > '\\[code\]'='<pre><code>',      // for [code] without option parameter
> >
> > '\\[code=(.*?)\](.*?)'='<pre><codeclass="\\1"data-language="\\1">\\2',
> > // for [code] with option parameter
> >
> > '\\[/code\]'='</code></pre>',   // for [/code] close tag
> >
> >
> >
> > but this example working correctly in one expression
> >
> > '\\[right\](.*?)\\[/right\]'='<spanclass="right">\\1</span>'
> >
> > [code] expression is same as [right] but not working me :-)
> > '\\[code\](.*?)\\[/code\]'='<pre><code>\\1</code></pre>',
> >
> > Maybe is problem with multiline option ([code][/code] is long text), but
> > this option I not find in Lasso docs.
> >
> >
> > I working on BBCode parser for Lasso.
> >
> > Thanks
> >
> > Lubos
> >
> >
> >
> > > Bil Corry <mailto:[hidden email]>
> > > 16. apríla 2016 17:31
> > > It uses PCRE If it isn't working for you, my guess is you're missing
> the
> > > double backslashes. Can you provide an example of something you've
> tried
> > > that isn't working?
> > >
> > >
> > > - Bil
> > >
> > > On Sat, Apr 16, 2016 at 5:12 PM, Lassozone.com: LassoTalk <
> > >
> > > #############################################################
> > >
> > > This message is sent to you because you are subscribed to
> > > the mailing list Lasso [hidden email]
> > > Official list archives available at http://www.lassotalk.com
> > > To unsubscribe, E-mail to: <[hidden email]>
> > > Send administrative queries to <[hidden email]>
> > > Lassozone.com: LassoTalk <mailto:[hidden email]>
> > > 16. apríla 2016 17:12
> > > Hi all,
> > >
> > > Does anyone know what RegEx module is used in Lasso Lasso 8.5 and 8.6?
> > > I tried some RegEx tester and nearest is RegEx Coach. Unfortunately a
> > > lot of terms that I use in JavaScript, PHP or C# do not work in Lasso.
> > > Can you advice me an tool/software which is closest to the Lasso
> > > module RegEx?
> > >
> > > Thanks you for help
> > >
> > > Regards
> > >
> > > Lubos Voros
> > > senior front-end developer
> >
> >
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >   the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
> >
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso 8.5 and 8.6 RegEx Module

Lasso Talk
Bil,

thanks, this work correctly. I don't know how switch to multi-line mode :-)

Have a nice week end

Lubos

> Bil Corry <mailto:[hidden email]>
> 17. apríla 2016 8:49
> I tried it and it seems you need to turn on multi-line mode. I'm sure
> there's a Lasso way to do it, but I don't recall, I always just used the
> regex switch (?s) instead. It works if you do that:
>
> [
>
> var('text') = '
> some text
>
> [code]; Melodie Box
> ;Große Oktave
> .equ C0 = 38223
> .equ Cdis0 = 36077
> .equ D0 = 34053
> .equ Ddis0 = 32141
> .equ E0 = 30337
> .equ F0 = 28635
> .equ Fdis0 = 27027
> .equ G0 = 25510
> .equ Gdis0 = 24079
> .equ A0 = 22727
> .equ Adis0 = 21452
> .equ H0 = 20248
> [/code]
>
> more text
>
>
> ';
>
> var('out') =
> string_replaceregexp($text,-find='(?is)\\[code\\](.*)\\[/code\\]',-replace='<pre><code>\\1</code></pre>');
>
> $out;
>
> ]
>
>
> - Bil
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to <[hidden email]>
> Ke Carlton <mailto:[hidden email]>
> 17. apríla 2016 1:25
> As Bil mentioned; in Lasso 8.x you need to double escape all back slashes,
> ie.
>
> \[code\](.*)\[/code\]
>
> Becomes:
>
> \\[code\\](.*)\\[/code\\]
>
> So the full regexp would be:
>
> string_replaceregexp(
> 'Example [code]function(){}[/code]',
> -find = '\\[code\\](.*)\\[/code\\]',
> -replace = '<pre><code>\\1</code></pre>'
> )
>
> In Lasso 9 you can use back ticks:
>
> -find = `\[code\](.*)\[/code\]`
>
> Which is much nicer.
>
> Ke
>
>
> On Sun, Apr 17, 2016 at 3:52 AM Lassozone.com: LassoTalk <
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to <[hidden email]>
> Lassozone.com: LassoTalk <mailto:[hidden email]>
> 16. apríla 2016 17:51
> Bill,
> I use escape backslashes :-)
>
> Example from RegEx Coach:
>
> expression:
> \[code\](.*)\[/code\]
>
> replace string:
> <pre><code>\1</code></pre>
>
> text:
> [code]; Melodie Box
> ;Große Oktave
> .equ C0    = 38223
> .equ Cdis0 = 36077
> .equ D0    = 34053
> .equ Ddis0 = 32141
> .equ E0    = 30337
> .equ F0    = 28635
> .equ Fdis0 = 27027
> .equ G0    = 25510
> .equ Gdis0 = 24079
> .equ A0    = 22727
> .equ Adis0 = 21452
> .equ H0    = 20248
> [/code]
>
> In Lasso I must use (I have all expressions in array with replace
> strings):
> Only this working correctly.
> '\\[code\]'='<pre><code>', // for [code] without option parameter
>
> '\\[code=(.*?)\](.*?)'='<pre><code class="\\1" data-language="\\1">\\2',
> // for [code] with option parameter
>
> '\\[/code\]'='</code></pre>', // for [/code] close tag
>
>
> but this example working correctly in one expression
> '\\[right\](.*?)\\[/right\]'='<span class="right">\\1</span>'
>
> [code] expression is same as [right] but not working me :-)
> '\\[code\](.*?)\\[/code\]'='<pre><code>\\1</code></pre>',
>
> Maybe is problem with multiline option ([code][/code] is long text),
> but this option I not find in Lasso docs.
>
>
> I working on BBCode parser for Lasso.
>
> Thanks
>
> Lubos
>
>
>
> Bil Corry <mailto:[hidden email]>
> 16. apríla 2016 17:31
> It uses PCRE If it isn't working for you, my guess is you're missing the
> double backslashes. Can you provide an example of something you've tried
> that isn't working?
>
>
> - Bil
>
> On Sat, Apr 16, 2016 at 5:12 PM, Lassozone.com: LassoTalk <
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to <[hidden email]>
> Lassozone.com: LassoTalk <mailto:[hidden email]>
> 16. apríla 2016 17:12
> Hi all,
>
> Does anyone know what RegEx module is used in Lasso Lasso 8.5 and 8.6?
> I tried some RegEx tester and nearest is RegEx Coach. Unfortunately a
> lot of terms that I use in JavaScript, PHP or C# do not work in Lasso.
> Can you advice me an tool/software which is closest to the Lasso
> module RegEx?
>
> Thanks you for help
>
> Regards
>
> Lubos Voros
> senior front-end developer

--
*Best Regards*


*Lubos Vörös*
*
**
**BULL**SOFT LTD*
145-157 ST JOHN STREET
EC1V 4PW  LONDON
UNITED KINGDOM*
*E-mail: [hidden email] <mailto:[hidden email]>
Mobile: +421.948.636.404

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso 8.5 and 8.6 RegEx Module

Bil Corry-3
The Lasso regex engine understands a variety of regex switches, which you
can see here:

  http://www.regular-expressions.info/modifiers.html

So for your example, I used the switch (?s) single-line mode to include
line breaks in the dot-star capture.  I also added the case-insensitive
switch (?i) for good measure, but I think Lasso defaults to it already.  So
that's why I have (?is) at the beginning of the regex string.


- Bil

On Sun, Apr 17, 2016 at 9:10 AM, Lassozone.com: LassoTalk <
[hidden email]> wrote:

> Bil,
>
> thanks, this work correctly. I don't know how switch to multi-line mode :-)
>
> Have a nice week end
>
> Lubos
>
> Bil Corry <mailto:[hidden email]>
>> 17. apríla 2016 8:49
>>
>> I tried it and it seems you need to turn on multi-line mode. I'm sure
>> there's a Lasso way to do it, but I don't recall, I always just used the
>> regex switch (?s) instead. It works if you do that:
>>
>> [
>>
>> var('text') = '
>> some text
>>
>> [code]; Melodie Box
>> ;Große Oktave
>> .equ C0 = 38223
>> .equ Cdis0 = 36077
>> .equ D0 = 34053
>> .equ Ddis0 = 32141
>> .equ E0 = 30337
>> .equ F0 = 28635
>> .equ Fdis0 = 27027
>> .equ G0 = 25510
>> .equ Gdis0 = 24079
>> .equ A0 = 22727
>> .equ Adis0 = 21452
>> .equ H0 = 20248
>> [/code]
>>
>> more text
>>
>>
>> ';
>>
>> var('out') =
>>
>> string_replaceregexp($text,-find='(?is)\\[code\\](.*)\\[/code\\]',-replace='<pre><code>\\1</code></pre>');
>>
>> $out;
>>
>> ]
>>
>>
>> - Bil
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to <[hidden email]>
>> Ke Carlton <mailto:[hidden email]>
>> 17. apríla 2016 1:25
>> As Bil mentioned; in Lasso 8.x you need to double escape all back slashes,
>> ie.
>>
>> \[code\](.*)\[/code\]
>>
>> Becomes:
>>
>> \\[code\\](.*)\\[/code\\]
>>
>> So the full regexp would be:
>>
>> string_replaceregexp(
>> 'Example [code]function(){}[/code]',
>> -find = '\\[code\\](.*)\\[/code\\]',
>> -replace = '<pre><code>\\1</code></pre>'
>> )
>>
>> In Lasso 9 you can use back ticks:
>>
>> -find = `\[code\](.*)\[/code\]`
>>
>> Which is much nicer.
>>
>> Ke
>>
>>
>> On Sun, Apr 17, 2016 at 3:52 AM Lassozone.com: LassoTalk <
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to <[hidden email]>
>> Lassozone.com: LassoTalk <mailto:[hidden email]>
>> 16. apríla 2016 17:51
>>
>> Bill,
>> I use escape backslashes :-)
>>
>> Example from RegEx Coach:
>>
>> expression:
>> \[code\](.*)\[/code\]
>>
>> replace string:
>> <pre><code>\1</code></pre>
>>
>> text:
>> [code]; Melodie Box
>> ;Große Oktave
>> .equ C0    = 38223
>> .equ Cdis0 = 36077
>> .equ D0    = 34053
>> .equ Ddis0 = 32141
>> .equ E0    = 30337
>> .equ F0    = 28635
>> .equ Fdis0 = 27027
>> .equ G0    = 25510
>> .equ Gdis0 = 24079
>> .equ A0    = 22727
>> .equ Adis0 = 21452
>> .equ H0    = 20248
>> [/code]
>>
>> In Lasso I must use (I have all expressions in array with replace
>> strings):
>> Only this working correctly.
>> '\\[code\]'='<pre><code>', // for [code] without option parameter
>>
>> '\\[code=(.*?)\](.*?)'='<pre><code class="\\1" data-language="\\1">\\2',
>> // for [code] with option parameter
>>
>> '\\[/code\]'='</code></pre>', // for [/code] close tag
>>
>>
>> but this example working correctly in one expression
>> '\\[right\](.*?)\\[/right\]'='<span class="right">\\1</span>'
>>
>>
>> [code] expression is same as [right] but not working me :-)
>> '\\[code\](.*?)\\[/code\]'='<pre><code>\\1</code></pre>',
>>
>> Maybe is problem with multiline option ([code][/code] is long text), but
>> this option I not find in Lasso docs.
>>
>>
>> I working on BBCode parser for Lasso.
>>
>> Thanks
>>
>> Lubos
>>
>>
>>
>> Bil Corry <mailto:[hidden email]>
>> 16. apríla 2016 17:31
>> It uses PCRE If it isn't working for you, my guess is you're missing the
>> double backslashes. Can you provide an example of something you've tried
>> that isn't working?
>>
>>
>> - Bil
>>
>> On Sat, Apr 16, 2016 at 5:12 PM, Lassozone.com: LassoTalk <
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to <[hidden email]>
>> Lassozone.com: LassoTalk <mailto:[hidden email]>
>> 16. apríla 2016 17:12
>> Hi all,
>>
>> Does anyone know what RegEx module is used in Lasso Lasso 8.5 and 8.6? I
>> tried some RegEx tester and nearest is RegEx Coach. Unfortunately a lot of
>> terms that I use in JavaScript, PHP or C# do not work in Lasso.
>> Can you advice me an tool/software which is closest to the Lasso module
>> RegEx?
>>
>> Thanks you for help
>>
>> Regards
>>
>> Lubos Voros
>> senior front-end developer
>>
>
> --
> *Best Regards*
>
>
> *Lubos Vörös*
> *
> **
> **BULL**SOFT LTD*
> 145-157 ST JOHN STREET
> EC1V 4PW  LONDON
> UNITED KINGDOM*
> *E-mail: [hidden email] <mailto:[hidden email]>
> Mobile: +421.948.636.404
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso 8.5 and 8.6 RegEx Module

Lasso Talk
thank you for help

Regards

Lubos

> Bil Corry <mailto:[hidden email]>
> 18. apríla 2016 10:47
> The Lasso regex engine understands a variety of regex switches, which you
> can see here:
>
> http://www.regular-expressions.info/modifiers.html
>
> So for your example, I used the switch (?s) single-line mode to include
> line breaks in the dot-star capture. I also added the case-insensitive
> switch (?i) for good measure, but I think Lasso defaults to it already. So
> that's why I have (?is) at the beginning of the regex string.
>
>
> - Bil
>
> On Sun, Apr 17, 2016 at 9:10 AM, Lassozone.com: LassoTalk <
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to <[hidden email]>
> Lassozone.com: LassoTalk <mailto:[hidden email]>
> 17. apríla 2016 9:10
> Bil,
>
> thanks, this work correctly. I don't know how switch to multi-line
> mode :-)
>
> Have a nice week end
>
> Lubos
>
>
> Bil Corry <mailto:[hidden email]>
> 17. apríla 2016 8:49
> I tried it and it seems you need to turn on multi-line mode. I'm sure
> there's a Lasso way to do it, but I don't recall, I always just used the
> regex switch (?s) instead. It works if you do that:
>
> [
>
> var('text') = '
> some text
>
> [code]; Melodie Box
> ;Große Oktave
> .equ C0 = 38223
> .equ Cdis0 = 36077
> .equ D0 = 34053
> .equ Ddis0 = 32141
> .equ E0 = 30337
> .equ F0 = 28635
> .equ Fdis0 = 27027
> .equ G0 = 25510
> .equ Gdis0 = 24079
> .equ A0 = 22727
> .equ Adis0 = 21452
> .equ H0 = 20248
> [/code]
>
> more text
>
>
> ';
>
> var('out') =
> string_replaceregexp($text,-find='(?is)\\[code\\](.*)\\[/code\\]',-replace='<pre><code>\\1</code></pre>');
>
> $out;
>
> ]
>
>
> - Bil
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to <[hidden email]>
> Ke Carlton <mailto:[hidden email]>
> 17. apríla 2016 1:25
> As Bil mentioned; in Lasso 8.x you need to double escape all back slashes,
> ie.
>
> \[code\](.*)\[/code\]
>
> Becomes:
>
> \\[code\\](.*)\\[/code\\]
>
> So the full regexp would be:
>
> string_replaceregexp(
> 'Example [code]function(){}[/code]',
> -find = '\\[code\\](.*)\\[/code\\]',
> -replace = '<pre><code>\\1</code></pre>'
> )
>
> In Lasso 9 you can use back ticks:
>
> -find = `\[code\](.*)\[/code\]`
>
> Which is much nicer.
>
> Ke
>
>
> On Sun, Apr 17, 2016 at 3:52 AM Lassozone.com: LassoTalk <
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to <[hidden email]>
> Lassozone.com: LassoTalk <mailto:[hidden email]>
> 16. apríla 2016 17:51
> Bill,
> I use escape backslashes :-)
>
> Example from RegEx Coach:
>
> expression:
> \[code\](.*)\[/code\]
>
> replace string:
> <pre><code>\1</code></pre>
>
> text:
> [code]; Melodie Box
> ;Große Oktave
> .equ C0    = 38223
> .equ Cdis0 = 36077
> .equ D0    = 34053
> .equ Ddis0 = 32141
> .equ E0    = 30337
> .equ F0    = 28635
> .equ Fdis0 = 27027
> .equ G0    = 25510
> .equ Gdis0 = 24079
> .equ A0    = 22727
> .equ Adis0 = 21452
> .equ H0    = 20248
> [/code]
>
> In Lasso I must use (I have all expressions in array with replace
> strings):
> Only this working correctly.
> '\\[code\]'='<pre><code>', // for [code] without option parameter
>
> '\\[code=(.*?)\](.*?)'='<pre><code class="\\1" data-language="\\1">\\2',
> // for [code] with option parameter
>
> '\\[/code\]'='</code></pre>', // for [/code] close tag
>
>
> but this example working correctly in one expression
> '\\[right\](.*?)\\[/right\]'='<span class="right">\\1</span>'
>
> [code] expression is same as [right] but not working me :-)
> '\\[code\](.*?)\\[/code\]'='<pre><code>\\1</code></pre>',
>
> Maybe is problem with multiline option ([code][/code] is long text),
> but this option I not find in Lasso docs.
>
>
> I working on BBCode parser for Lasso.
>
> Thanks
>
> Lubos
>
>
>

--
*Best Regards*


*Lubos Vörös*
*
**
**BULL**SOFT LTD*
145-157 ST JOHN STREET
EC1V 4PW  LONDON
UNITED KINGDOM*
*E-mail: [hidden email] <mailto:[hidden email]>
Mobile: +421.948.636.404

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>