Reputation: 2281
I'm newbie in regex. I want create a regex for:
Here is something I try to match '--' in first and '$' in last but not work
/^--.*[--](\$)$/g
String I want to pass this regex: --hostname=$HOSTADDRESS$
How can I do that. Please help me
Upvotes: 1
Views: 892
Reputation: 4375
You need to include the m
flag after /g
to enable multiline ^
and $
.
I don't know what you were trying to do with [--]
, but to match =$
you need to include =\$
in your regex.
Upvotes: 2