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.
/\?(?!xml)/ig私は何かを探す2つのJS正規表現を持っていますか?/\?(?!>)/ig文字列「xml」とそれを探す別の文字列が続きませんか?">"が続きません。
/\?(?!xml)/ig
/\?(?!>)/ig
両方を1つの正規表現に組み合わせるにはどうすればよいですか?
どうですか:
/\?(?!(xml|>))/gi
編集:いずれの場合も、RegExpの代わりにパーサーを使用してXMLを適切に解析することを検討してください。