2016-06-01 6 views
-3

私は「* * & ABC = 123 & ** & DEFG = HH &」次の文字列を持っているので、パターンの開始と終了に& &であると私はしたいと思います私はregex.matchesを行う場合は、次のを持っているかregex.split文字列に正規表現マッチパターンを複数回

最初マッチ= & ABC = 123 & 2マッチ= & DEFG = HH &

は、あなたができるようにしたいものを文字に応じて、[0-9A-ZA-Z]を変更する必要があります任意の助け

+0

パターンごとにパターンの開始と終了* && * – user1293971

+0

適切な書式を使用してください。それは、あなたが意味することを正確に知ることは少し難しいです。また、その入力文字列にはどこでも '&&'のインスタンスがありません。 –

答えて

1
&[0-9a-zA-Z]+=[0-9a-zA-Z]+& 

を感謝しています。

& matches the characters & literally 
[0-9a-zA-Z]+ match a single character present in the list below 
    Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy] 
    0-9 a single character in the range between 0 and 9 
    a-z a single character in the range between a and z (case sensitive) 
    A-Z a single character in the range between A and Z (case sensitive) 
= matches the character = literally 
[0-9a-zA-Z]+ match a single character present in the list below 
    Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy] 
    0-9 a single character in the range between 0 and 9 
    a-z a single character in the range between a and z (case sensitive) 
    A-Z a single character in the range between A and Z (case sensitive) 
& matches the characters & literally 
+0

こんにちはRudyはトリックをしました:-)実際には – user1293971

+0

@ user1293971に感謝します。 –

関連する問題