Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はここにこの正規表現を持っています:
"\d+.?\d*\^\d+\.?\d*"
それがすべきことは、のような2^10文字列のようなものを見つけることです1*1+2^10*1が、それはで戻ってき1+2^10ます。
2^10
1*1+2^10*1
1+2^10
私は何が間違っているのですか?.私はそれが?と関係があると思います
.
正規表現では、.文字は「任意の文字に一致」を表します。あなたはそれを逃れる必要があります:
"\d+\.?\d*\^\d+\.?\d*"
RegexPalを使用して正規表現を試すことができます