Use Special Characters in Python Regular Expression

Rajendra Dharmkar
Updated on 13-Jun-2020 07:12:45

7K+ Views

From Python documentationNon-special characters match themselves. Special characters don't match themselves −\ Escape special char or start a sequence..Match any char except newline, see re.DOTALL^Match start of the string, see re.MULTILINE $  Match end of the string, see re.MULTILINE[ ]Enclose a set of matchable charsR|S Match either regex R or regex S.()Create capture group, & indicate precedenceAfter '[', enclose a set, the only special chars are −]End the set, if not the 1st char-A range, eg. a-c matches a, b or c^Negate the set only if it is the 1st char    Quantifiers (append '?' for non-greedy) −{m}Exactly m repetitions {m, n}From m (default 0) ... Read More

Avoid Global Variables in JavaScript

Ali
Ali
Updated on 13-Jun-2020 07:10:36

1K+ Views

Avoid global variables or minimize the usage of global variables in JavaScript. This is because global variables are easily overwritten by other scripts. Global Variables are not bad and not even a security concern, but it shouldn’t overwrite values of another variable.On the usage of more global variables in our code, it may lead to a maintenance issue. Let’s say we added a variable with the same name. In that case, get ready for some serious bugs.To avoid the usage of global variables, use the local variables and wrap your code in closures. You can also avoid this by wrapping ... Read More

Write Inline JavaScript Code in HTML Page

Rahul Sharma
Updated on 13-Jun-2020 07:08:11

759 Views

Inline JavaScript Code − If you are adding some JavaScript code in an HTML file without using the src tag then it is known as inline JavaScript code. That’s all you need to know.

Basic Examples of Python Regular Expressions

Rajendra Dharmkar
Updated on 13-Jun-2020 06:54:06

311 Views

Here are two basic examples of Python regular expressionsThe re.match() method finds match if it occurs at start of the string. For example, calling match() on the string ‘TP Tutorials Point TP’ and looking for a pattern ‘TP’ will match. However, if we look for only Tutorials, the pattern will not match. Let’s check the code.Exampleimport re result = re.match(r'TP', 'TP Tutorials Point TP') print resultOutputThe re.search() method is similar to re.match() but it doesn’t limit us to find matches at the beginning of the string only. Unlike in re.match() method, here searching for pattern ‘Tutorials’ in the string ‘TP ... Read More

Using DataType Element for Destination in SAP ABAP

Amit Sharma
Updated on 13-Jun-2020 06:50:29

253 Views

You can use RFCDEST.RFCDEST statement specifies the destination value for a Remote Function Call connection and gateway information.Supported Job Types:This statement are optional for the following job types:SAP Batch Input SessionSAP Business Warehouse InfoPackageSAP Business Warehouse Process ChainSAP Data ArchivingSAP Event MonitorSAP Job CopySAP Process MonitorSAP R/3Basic DataTable  RFCDES  Destination table for Remote Function CallField  RFCDEST  Logical Destination (Specified in Function Call)Position 1Syntax to be used:RFCDEST destinationUsing Parameter destinationYou need to specify the destination for the RFC connection and gateway information for an SAP R/3 system. This destination is the destination that is specified in the connection properties file during ... Read More

Is it Better to Have One Big JavaScript File or Multiple Light Files?

Amit Sharma
Updated on 13-Jun-2020 06:48:03

1K+ Views

To avoid multiple server requests, group your JavaScript files into one. Whatever you use for performance, try to minify JavaScript to improve the load time of the web page.If you are using single page application, then group all the scripts in a single file.If you are using multiple files, then minify all of your scripts and separate them into categories.example - Place JavaScript to be used in every page. This can be the core script of the file. - Place your plugins hereRest, add other scripts in a JavaScript file. It’s good to maintain it in different files.Read More

Why Using the JavaScript eval Function is a Bad Idea

Daniol Thomas
Updated on 13-Jun-2020 06:47:34

205 Views

The JavaScript eval() is used to execute an argument. The code gets execute slower when the eval() method is used. It also has security implementations since it has a different scope of execution.ExampleHere’s how you can implement eval() function −                     var a = 30;          var b = 12;          var res1 = eval("a * b") + "";          var res2 = eval("5 + 10") + "";          document.write(res1);          document.write(res2);          

Difference Between ++a and a++ in JavaScript

Krantik Chavan
Updated on 13-Jun-2020 06:46:22

8K+ Views

++a returns the value of an after it has been incremented. It is a pre-increment operator since ++ comes before the operand.a++ returns the value of a before incrementing. It is a post-increment operator since ++ comes after the operand.ExampleYou can try to run the following code to learn the difference between i++ and ++i −                       var a =10;           var b =20;           //pre-increment operator           a = ++a;           document.write("++a = "+a);                       //post-increment operator           b = b++;           document.write(" b++ = "+b);          

Use the Same JavaScript in Multiple Content Pages

Rahul Sharma
Updated on 13-Jun-2020 06:45:08

2K+ Views

To use the same JavaScript in more than one page, add the js code in an external JavaScript file. Let’s say the following demo.js is our external JavaScript file −function display() {    alert("Hello World!"); }Now add the external JavaScript file to the following HTML web page. In the same way, you can add it to multiple content page.                                          

How the Browser Identifies Inline JavaScripts

Johar Ali
Updated on 13-Jun-2020 06:44:28

484 Views

Let’s say the following line we have in our HTML −Here the browser identifies inline JavaScript by detecting onclick, even when tag wasn’t available.The following are some of the suggestions for using inline JavaScripts −You should consider inline script elements such as ...) if the script only to be used for a single page.Do not use event attributes such as onclick="...", and bind event handlers using JavaScript.Use external script elements such as ) for most scripts, especially if reused between pages.

Advertisements