• Regular expressions that allow only a few characters in a URL


    For example, the restriction allows only the followinga-Z 0-9 Http: / / match coherenceHTTPS: / / match coherence/It is not allowed to appear two times in succession& % ? do not appear two times in succession=Equal sign-Middle dashA kind of Underline. points are important There are the following regular coincidence ^((?:http|https)://)?((?![/?]{2,})[a-zA-Z0-9\-._%&=/?])+$ Regexbuddy3 translation tool ^((?:http|https)://)?((?![/?]{2,})[a-zA-Z0-9\-._%&=/?])+$ […]

  • JS verifies that the URL function is regular


    This URL‘s regular expression judges JavaScript! More comprehensive. It verifies the situation including IP, domain, FTP, secondary domain name, file in domain name, domain name plus port! User name and other information, it seems that the author is also looking for it on the Internet. I deducted it from a project code, which is the […]

  • IOS reads the URL image and stores it to the local instance


    Examples are as follows: dispatch_queue_t globalQueue = dispatch_get_global_queue(0, 0); dispatch_async(globalQueue, ^{ NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:banarModel.avatar.url]]; UIImage *image = [UIImage imag eWithData:data ]; // get pictures //Local sandbox directory NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; //Get the path named “myimage” in the local sandbox, which is the name of the saved image NSString […]

  • How to identify multiple URLs and click jump in Android textview


    Implementation scheme: We refer directly to the example code: private String pattern = “((http|ftp|https)://)(([a-zA-Z0-9\\._-]+\\.[a-zA-Z]{2,6})|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,4})*(/[a-zA-Z0-9\\&%_\\./-~-]*)?|(([a-zA-Z0-9\\._-]+\\.[a-zA-Z]{2,6})|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,4})*(/[a-zA-Z0-9\\&%_\\./-~-]*)?”; Pattern r = Pattern.compile(pattern); Matcher m; mTv.setText(identifyUrl(richURL.msg)); public SpannableStringBuilderForAllvers identifyUrl(CharSequence text) { CharSequence contextText; CharSequence clickText; text = text == null ? “” : text; //The following is used to splice the existing spantext SpannableStringBuilderForAllvers span = new SpannableStringBuilderForAllvers(text); ClickableSpan[] clickableSpans […]

  • Download the URL of Python 3 in all ways


    Get the information of the home page elements: Target test_ URL: http://www.xxx.com.cn/ First of all, check the element. Under the a tag, we need to crawl to get the link. By getting the link path, we can locate the information we need soup = Bs4(reaponse.text, “lxml”) urls_li = soup.select(“#mainmenu_top > div > div > ul […]

  • How to get the URL of the previous page and the URL of this page


    1. Get the URL of the previous page: String url=request.getHeader(“Referer”); 2. To get the URL of this page: String url=request.getScheme()+”://”+ request.getServerName()+request.getRequestURI();

  • Go call browse to visit URL link


    1. Background When developing a program, you need to open the browser to save the trouble of manually opening it by users. There are ways to directly open it in golang, Start and XDG open are the tools for windows, MAC and Linux to open the system default program,So if you want to use Google […]

  • Processing method of URL passing Chinese parameters in JSP


    Encodeuri (encodeuri (Chinese)) is used in the URL of the page to encode Chinese, and is used in the Java program of the server URLDecoder.decode (Chinese, “UTF-8”) can be decoded;If the URL needs to pass +, ා? Encodeurcomponent (encoding component (Chinese)) can be used. The decoding method of server is the same as that of […]

  • ASP.NET The implementation code of page value transfer by changing URL


    Here, create a class manually through false data, and then create a collection. Put it into the drop-down box. After selecting the value, click OKThe corresponding ID will be generated on another page Create a class: using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace WebApplication1 { public class Dept { public int Id { […]

  • VBScript clipboard grabs URL and opens in browser


    Hello, CL. This is a very interesting question, or we should say that these are two very interesting questions. Because you actually asked two questions. The first question is simple: can I use scripts to open specific web sites? You probably already know the answer, I can answer you loudly, yes! Here is a sample […]

  • Ruby writes a script to scan all URLs of the current web page


    #scanweb.rb #Use ruby scanweb.rb www.jb51.net to save the current result in C: \ 1.txt require ‘net/http’ filename= File.new(‘c:\1.txt’,”w+”) if $*[0]==nil  Put “hehe, no URL entered”else h = Net::HTTP.new($*[0], 80) resp, data = h.get(‘/index.html’, nil) if resp.message == “OK” data.scan(/<a href=”(.*?)”/).each do |x| puts x filename.puts x end end end #Boring, there are VBS, PHP and Ruby versions. It seems that ruby is faster than VBS, which is comparable to PHP. =begin Modify it […]

  • Using VBS to get all link names and URLs in favorites


    In addition, you can consider outputting the link as a hyperlink, and changing the output file to an HTML file.GetFavorites.vbs: Copy codeThe code is as follows: ‘=================================================================== Const FAVORITES = &H6& Const ForWriting = 2 Set objShell = CreateObject(“shell.application”) Set objFolder = objShell.Namespace(FAVORITES) Set fso = CreateObject (“scripting.filesystemobject”) processGet objFolder Set objFolder = Nothing Set […]