javascript regex: `foo` -> **foo**? -


basically, hack markdown engine own website.

now, i'm trying convert string wrapped single `

`foo`  

to

 **foo** 

using regex , far, can think of

    var data = data0.replace(/`.*`/g, '...'); 

and obviously, not work intend.

and markdown has

```  ``` 

format, , want untouched- exclude regex match.

can advise regex be?

thank you.

this attempt @ simple, clean regex:

regex string

`\b(.*?)\b`(?!`) 

replace string

**$1** 

online demonstration

regex101


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -