translating RegEx syntax working in php and python to JS
<p>I have this RegEx syntax: "(?&lt;=[a-z])-(?=[a-z])"</p>

<p>It captures a dash between 2 lowercase letters. In example below the second dash is captured:</p>

<p>Krynica-ZdrÃ³j, ul. Uzdro-jowa</p>

<p>Unfortunately I can't use &lt;= in JS.
My ultimate goal is to remove the hyphen with RegEx replace.</p>

<p>It seems to me you need to remove the hyphen in between lowercase letters.</p>

<p>Use</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var s = "Krynica-ZdrÃ³j, ul. Uzdro-jowa";
var res = s.replace(/([a-z])-(?=[a-z])/g, "$1");
console.log(res);</code></pre>
</div>
</div>
</p>

<p>Note the first lookbehind is turned into a simple capturing group and the second lookahead is OK to use since - potentially, if there are chunks of hyphenated single lowercase letters - it will be able to deal with overlapping matches.</p>

<p><em>Details</em>:</p>

<ul>
<li><code>([a-z])</code> - Group 1 capturing a lowercase ASCII letter</li>
<li><code>-</code> - a hyphen</li>
<li><code>(?=[a-z])</code> - that is followed with a lowercase ASCII letter that is not added to the result
-<code>/g</code> - a global modifier, search for all occurrences of the pattern</li>
<li><code>"$1"</code> - the replacement pattern containing just the backreference to the value stored in Group 1 buffer.</li>
</ul>

<p><strong>VBA sample code</strong>:</p>

<pre><code>Sub RemoveExtraHyphens()
Dim s As String
Dim reg As New regexp

reg.pattern = "([a-z])-(?=[a-z])"
reg.Global = True

s = "Krynica-Zdroj, ul. Uzdro-jowa"
Debug.Print reg.Replace(s, "$1")
End Sub
</code></pre>

<p><a href="http://i.stack.imgur.com/kf40d.png" rel="nofollow"><img src="http://i.stack.imgur.com/kf40d.png" alt="enter image description here"></a></p>

javascript php python regex