Splitting strings using Regular Expressions

If you need help on how to use the program
Post Reply
fulvio53s03
Posts: 745
Joined: 2007-04-28 05:46:43
Location: Italy

Splitting strings using Regular Expressions

Post 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.
antp
Site Admin
Posts: 9636
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Re: Splitting strings using Regular Expressions

Post 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
Post Reply