Wikipedia talk:AutoEd/isbn.js

Latest comment: 12 years ago by Anomie in topic Simplified

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

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

  Done You have an extra paren after the 'gi', but otherwise yes. Anomie 14:18, 9 February 2012 (UTC)Reply