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.
我找到了 3 种不同的方法来获取HTML 字符串中标签src属性的值。img
src
img
那么我必须使用哪种方式来优化我的 iPhone 应用程序的性能?
也许不是最快的,但 RegEx 是最通用和最便携的方法。除非你真的每秒进行数百次解析,否则你不会注意到不使用最快的方法会对性能造成的影响..
当用户输入文本时,我在 iPhone 上使用大量正则表达式进行用户输入验证(因此肯定会看到滞后)。从来没有任何问题。