On Fri, Jul 22, 2011 at 3:06 PM, Phil Shafer <[email protected]> wrote:
> ben b writes:
> >> i'm try to find out the number of pipes "|" in all of my interface
> >> descriptions, but for some reason the jcs:split() function errors out in
> my
> >> commit script. Does anyone have any suggestions?
>
> jcs:split() takes a pattern (regex) instead of a simple string. You'll
> need to escape the "|" to prevent it from being interpreted in the
> regex context. You escape this using a backslash, but you also need
> to escape the backslash since SLAX interprets this as _it's_ escape
> character as well. So you'll end up needing:
>
> var $description_parts = jcs:split("\\|", description);
>
> Thanks,
> Phil
>
Thanks Phil, that worked.... that would be why my error was regex empty
expression. :)
_______________________________________________
juniper-nsp mailing list [email protected]
https://puck.nether.net/mailman/listinfo/juniper-nsp