I am trying to find a string between space and colon. For that I have the below regex expression which is giving me an 'invalid group name' error (same in python also):
(?<content>[^ :]*:$)
Here is RegexDemo
Same Expression has no error in PHP Demo.
Javascript expression :-
var reg = new RegExp("(?<content>[^ :]*):$", "g");`
Can anybody tell me why should be this?
Edit:
Sample Input:
DefVariable 変数名:配列「n]
DefVariable 変数名:string
DefVariable 変数名:int
DefVariable 変数名:decimal
DefVariable 変数名:日付
DefVariable 変数名:時間
Sample Output:
Could be match 変数名: from each line where instead of 変数名 any character will come.