Quantcast
Channel: Adobe Community: Message List - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 3715

Re: Finding text with RegEx

$
0
0

Hi Jang, You are correct that JavaScript regular expressions don't have look behind. But in this case, it is not necessary anyway. Just use this:

 

var string = "[Content with square brackets]";
var regex = /\[([^\]]+)\]/;

if (string.match (regex) !== null) {
    alert (string.match (regex)[1]);
}

 

Rick


Viewing all articles
Browse latest Browse all 3715

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>