Regex replace Harvard style bibliography references \d{4}:\s\d+ with comma -



Regex replace Harvard style bibliography references \d{4}:\s\d+ with comma -

harvard bibliography, if not utilize mendeley on time can tough.

[sihler 1999: 122; trask 2000: 164]. [benveniste 1935: 170-171, Бенвенист 1955, bomhard, kerns 1994: 56-59].

the way quote authors in phd wrong. should have had , instead of :. like

[sihler 1999, 122; trask 2000, 164].

with \d{4}:\s\d+ http://regex101.com/r/me0rt9/1 can find them, how replace , instead of : in word? thanks.

you need utilize lookahead , lookbehind or backreferences, http://www.regular-expressions.info/lookaround.html.

i this: preg_replace("~(\d{4}):(\s\d+)~", "$1,$2", $str) in php instance illustration of latter solution.

here's post talks backreferences in javascript: javascript - string regex backreferences

regex

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -