Page 1 of 1

Splitting strings using Regular Expressions

Posted: 2024-09-27 16:40:32
by fulvio53s03
E' possibile spezzare una stringa "troppo lunga" contenente vari periodi usando una espressione regolare?
Io uso "SIGIL" per gli epub e l'espressione regolare è:
- cambia '(.{399})([^ ]+)(\.\s)(.)'
- in '\1\2.</p>\n\n<p>\4'
per spezzare stringhe lunghe più di 399 caratteri al punto successivo.
Sarebbe possibile la stessa cosa in uno script AMC?
grazie.

Is it possible to break a "too long" string containing several periods using a regular expression?
I use "SIGIL" for epubs and the regular expression is:
- change '(.{399})([^ ]+)(\.\s)(.)'
- in ''\1\2.</p>\n\n<p>\4'
to break strings longer than 399 characters to the next period.
Would the same thing be possible in an AMC script?
Thank you.

Re: Splitting strings using Regular Expressions

Posted: 2024-09-28 15:03:41
by antp
There are regular expressions functions in AMC scripts, so I guess these should work.
That was added by Mickaël so I do not know by head how it works, if you check the list of functions in the help file and search for regular expressions, you'll find the list. I hope that the documentation will help you enough :D