我正在尝试编写一个执行以下操作的正则表达式: - 查找至少一个=
,并将它们=
带到 1)行尾或 2)一个点.
正则表达式:
[=]+?[=]+.*?[.$]+
测试字符串:
b == 123 //does not match, but which should as it is end of line!
b == 123. //does match "== 123.", which is OK
b == 123.abc //does match "== 123.", which is OK
$
endofline锚在这里我错过了什么?