[英]How to match regex with end of line?
我正在嘗試編寫一個執行以下操作的正則表達式: - 查找至少一個=
,並將這些=
最多1)行結束,或2)點.
正則表達式:
[=]+?[=]+.*?[.$]+
Teststrings:
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 $
anchor我在這里缺少什么?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.