Wikipedia talk:AutoEd/isbn.js
Appearance
More parameters to check for
[edit]I've seen several occurances of ISBN 10 and ISBN 13 without the dash, so I suggest you add those to the script as well. To my knowldge no ISBNs start with 10 or 13, so it shouldn't be a problem adding these two. My suggestion is:
txt.value = txt.value.replace(new RegExp('ISBN-10:|ISBN-13:|ISBN 10:|ISBN 13:|ISBN-10|ISBN-13|ISBN:|ISBN 10|ISBN 13', 'gi'), 'ISBN');
-Helt (talk) 05:28, 29 April 2009 (UTC)
Simplified
[edit]![]() | This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
I think this does the same thing but with less code.
str = str.replace(/ISBN-10:|ISBN-13:|ISBN-10|ISBN-13|ISBN:/gi), 'ISBN');
Best, --Kangaroopowah 07:01, 22 January 2012 (UTC)
Done You have an extra paren after the 'gi', but otherwise yes. Anomie⚔ 14:18, 9 February 2012 (UTC)