current location:Home > Technical Articles > Web Front-end

  • Regular expression to exclude text between brackets from matching
    Regular expression to exclude text between brackets from matching
    Given the following text: {field1}==value1&&{field2}==value2&&({field3}==value3&&{field4}==value4)&&{field5}==value5 I'm trying to create a text with all && on that text Regular expression that matches, but excludes what is between the brackets (so the && between value3 and field4 should be ignored). I've been able to do this using the following regex: (\&{2})(?![^\(]*\)) [This works and is doing what I need] but asking
    Golang . regular-expression 868 2024-02-09 21:51:09
  • CentOS SFTP installation and CentOS installation FTP
    CentOS SFTP installation and CentOS installation FTP
    As a Linux administrator, we often need to configure and install different services on CentOS servers. In this article, we will introduce in detail how to install and configure SFTP and FTP services on CentOS servers. CentOSSFTP installation Install OpenSSH We need to install the OpenSSH package, which is required to provide SFTP services. Execute the following command in the terminal to install OpenSSH: sudoyuminstallopenssh Create SFTP user Next, we need to create an SFTP user specifically for SFTP access. user, execute the following command to create a new user: sudoaddusersftpuser You need
    LINUX . regular-expression 1181 2024-02-09 20:18:20
  • Go test '-run -' flag executes tests much faster
    Go test '-run -' flag executes tests much faster
    I'm looking at some benchmarks from https://github.com/roaringbitmap/roaring. When running a specific benchmark using -run- (as mentioned in the comments): gotest-benchbenchmarknexts-benchmem-run- it seems to execute faster, at least Running it without -run- seems to have some initial overhead of 5 seconds, which is also plotted: ==roaring=={1,2,3,4,5,100,1000}{3,4,1000} {}Cardinality:7Contains
    Golang . regular-expression 407 2024-02-09 19:21:08
  • Install OpenResty on CentOS and install OpenStack on CentOS
    Install OpenResty on CentOS and install OpenStack on CentOS
    In modern cloud computing environments, CentOS is a commonly used operating system, and OpenResty and OpenStack are two commonly used open source software. This article will introduce how to install OpenResty and OpenStack on CentOS and provide detailed steps and instructions. Before installing any software, first make sure that the system is up to date. Open a terminal and enter the following command: sudoyumupdate This will update the system and install the latest software packages. To install OpenResty, you need to add the official repository of OpenResty first and execute the following command in the terminal: sudoyuminstallyum-utilssudoyum-
    LINUX . regular-expression 1051 2024-02-09 19:00:08
  • Detailed explanation of WinPE installation depth of Linux and PE installation depth of Linux system
    Detailed explanation of WinPE installation depth of Linux and PE installation depth of Linux system
    Deepin Linux is an operating system based on the open source Linux kernel. It is stable, safe, and easy to use. This article will introduce how to install Deepin Linux using WinPE and PE systems. WinPE installs Deepin Linux. WinPE is a lightweight Windows pre-installation environment that can be used for system maintenance and repair. Using WinPE to install Deepin Linux requires the following steps: 1. Download the ISO image file of Deepin Linux and extract it to a FAT32 format. USB flash drive or mobile hard disk. 2. Download and create a WinPE bootable USB disk or CD. 3. Insert the prepared WinPE boot USB disk or CD into the computer, restart the computer and enter WinPE
    LINUX . regular-expression 771 2024-02-09 17:33:18
  • How to remove unwanted characters between keys and values ​​in JSON?
    How to remove unwanted characters between keys and values ​​in JSON?
    I have this JSON: {"key1":"value1",\n\n"key2":"value2\nwithnewline"} I want: Remove\n\nKeep value2\n and newline. So I will have a valid JSON. I've tried :regex but couldn't figure out how to specify outside of keys and values. And this: packagemainimport("bytes""fmt")funcmain(){jsonStr:=`{"key1":"value1",\n\n
    Golang . regular-expression 1122 2024-02-09 17:15:07
  • When formatting JSON using JavaScript, I get an error due to the '(double quote) flag in the data
    When formatting JSON using JavaScript, I get an error due to the '(double quote) flag in the data
    I use the following code snippet to clearly display all json strings in markup with id="jsontext" on the page. varp=document.queryselectorall("#jsontext");varparray=[...p]parray.foreach(p=>{vardata=p.textcontent;p.textcontent=json.stringify(json.parse(data),null ,2);}); However, when there are double quotes (") in the data
    Golang . regular-expression 1244 2024-02-09 16:10:08
  • CentOS installs LVS and CentOS installs virtual machine
    CentOS installs LVS and CentOS installs virtual machine
    As an open source operating system, LINUX's stability and reliability have been widely recognized and applied. Among LINUX systems, CentOS is a very popular version and is known for its stability and security. This article will introduce How to install LVS (LinuxVirtualServer) on CentOS system and how to install virtual machine on CentOS system. CentOS installation LVSLVS is a load balancing software based on the Linux kernel. It can distribute access requests to multiple servers, thereby improving the performance and reliability of the system. The following are the steps to install LVS on CentOS systems: 1. Make sure you CentOS system has installed the latest
    LINUX . regular-expression 466 2024-02-09 15:12:38
  • Regular expression for capturing optionally present groups in Go
    Regular expression for capturing optionally present groups in Go
    I'm trying to write a regular expression that in a string representing go code will replace the name of a type, e.g. bar, with an updated name, e.g. foobar, but only where it appears as a field type in another struct or Array of this type. For example, I want to convert typefoostruct{barbarbaz[]barbars[]bar} into typefoostruct{barfoobarbaz[]foobarbars[]foobar} so far I have successfully used this
    Golang . regular-expression 986 2024-02-09 14:10:31
  • Need a regex to validate 'earn an extra 20%' or 'earn an extra 20%'
    Need a regex to validate 'earn an extra 20%' or 'earn an extra 20%'
    A regular expression is needed to validate the string mentioned below. 'Earnextra20%'-valid'Earn20%extra'-valid'earnextra20%'-valid'earn20%extra'-valid'Earn20'-valid'Earn'-Invalid'20'-Invalid'Earn^&'-Invalid should not Allow any other special characters - use golang1.19
    Golang . regular-expression 528 2024-02-09 13:33:09
  • go test -run: how to specify package in test identifier
    go test -run: how to specify package in test identifier
    Suppose I have two packages foo/bar and foo/baz. Both foo/bar and foo/baz have a TestFoo, but I only want to run the TestFoo for foo/bar. Additionally, foo/baz has a TestBaz that I want to run. Is it possible to specify the gotest command to run only foo/bar::TestFoo and foo/baz::TestBaz? I tried using gotest-run to achieve this, but it looks like running the regex just filters by name, not by bundle identifier: gotest-run "TestFoo|TestBaz" f
    Golang . regular-expression 659 2024-02-09 12:50:19
  • Replace '.' with '_' Golang
    Replace '.' with '_' Golang
    I've been doing go programming on codewars as a hobby and stumbled upon the following task: The provided code should replace all points. in a specified string with dashes - but it doesn't work properly. Mission: Fix the bug so we can get home early. Initial error code: regexp.mustcompile(`.`).replaceallstring(str,"-") By brute force, I got it to work like this: regexp.mustcompile(`[.]`).replaceallstring(str,"-") The correct answer is obviously this: regexp.Must
    Golang . regular-expression 1114 2024-02-09 11:12:23
  • How to make an entire word optional in a regular expression?
    How to make an entire word optional in a regular expression?
    That is, I want to customize my regex to recognize the following apple and lemon, apple lemon, apple and and apple. I want and and lemon to be optional, currently I've only managed to make and optional, not lemon. It would be great if this could be achieved using the current regex format. Regular expression: \b([a][\W_]*?)+([p][\W_]*?)+([p][\W_]*?)+([l][\W_] *?)+([e][\W_]*?)+(([a][\W_]*?)+([n][\W_]*?)+([d][\W_]* ?))?([l
    Golang . regular-expression 482 2024-02-09 10:36:09
  • How to improve segmentation logic in golang
    How to improve segmentation logic in golang
    Consider the following examples as possible values ​​in the index: values:=[5]string{"32.5ms","32.5ms","32.5%","32.5%","none"} Note that the original value may have Spaces, and possibly spaces without measurement units (32.5%, 32.5%, 32.5%, etc.) I need to separate the floating point value and measurement unit (%, ms, etc.) from the original value, as in the following code, I get what I want results, but I'm wondering if there is a cleaner way to perform the same logic, perhaps without the need for regular expressions. packagemainimport("fmt""regex
    Golang . regular-expression 935 2024-02-09 10:00:41
  • How to match characters between two occurrences of the same but random string
    How to match characters between two occurrences of the same but random string
    The basic string looks like this: repeatedRandomStrABCXYZ/an/arbitrary/@#-~/sequence/of_characters=I+WANT+TO+MATCH/repeatedRandomStr/the/rest/of/strings.etc My understanding of this basic string is :abcxyz is constant and always present. repeatedrandomstr is random but its first occurrence is always at the beginning and before abcxyz So far I've looked into regex context matching, recursion and subroutines but can't figure it out myself
    Golang . regular-expression 1175 2024-02-09 09:57:26

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28