url - Why regex doesn't work? Swift -


I have this regex expression that works on iOS but not Does anyone know what is wrong?

  RegEx = Ansargyulr expression to (pattern: "v = (. +?) (? = \\ s | & amp;)", Options: Ansargyulrakspresokshnksnssnvednshil error: basic error:  v = (. +?) (? = \ S | & amp;)   

Regex is applied to this test URL (separate):

 < code> Https://wwwkutubkcom/wac?w=sjifp5oi6dE Https://wwwkutubkcom/wac?w=gdigmngdam∓ feature = Relmfu Https://wwwkutubkcom/wac?w= Gdigmngdam & amp; feature = Relmfu & amp; Asdsdsa Https://wwwkutubkcom/wac?w=gdigmngdam∓ficr=relmfu∓asdsdsa∓asdfksdsdsk%4∓ Asdsdsd Https://wwwkutubkcom/wac?ficr=relmfu∓ asdsadsa & asdfasdasdasQ% 4 & amp; asdsadsad & amp; v = gdigMMGadDM   

thanks The!

Edit 1:

Here is the code:

  // Get the Video ID var error: NSError? RegEx = Ansargyulr Akspsn (pattern: "v = (. +?) (? = \\ s | & amp;)", options: Ansargyulrakspresoptisessisinsensitiv, error and error) println (originalURL) or println (regex) mail: NSTextCheckingResult? = RegexkfirstMatchInString (original URL, Options: NSMatchingOptions (0), Category: Ansmkerenj (0, count Elements (original URL)) println (to match) Veedioaidi = (original URL as NSString). Sbstraging Vithrenj (Match!. range) Kstringby Riplisingokrrensofstring ( "V =", withString: "") println (videoID)   

"match" is zero!

edit 2 :

Expected Result:

... "Em> string end , because (? = \\ s | & amp;) The following white space or "& amp; character. " v = (. +?) (? = $ | & Amp;) "with you should get the expected result.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -