- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
ExampleLive Demoimport java.util.ArrayList; import java.util.List; import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class SearchRegex { private Pattern subPattern = Pattern.compile(SUBJECT_PATTERN); private Matcher matcher; private static final String SUBJECT_PATTERN = "(?s)Subject 1:\s(.*)Subject 2:"; public static void main(String[] args) { String d = "Subject 1: Java" + "Subject 2: Python"; SearchRegex obj = new SearchRegex(); List list = obj.getSubject(d); System.out.println("Address Result : " + list); } private List getSubject(String d){ List result = new ArrayList(); matcher = subPattern.matcher(d); while (matcher.find()) { result.add(matcher.group(1)); } return result; } }OutputAddress Result : [Java]
ExampleLive Demoimport java.util.regex.Matcher; import java.util.regex.Pattern; public class NoRegTest { public static void main(String[] args) { String s="^fun"; Pattern pattern = Pattern.compile(s); Matcher matcher = pattern.matcher("Java is fun"); if(!matcher.find()) { System.out.println("not found"); } } }Outputnot found
How to extract a group from a Java String that contains a Regex patternimport java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexTest { public static void main(String[] args) { Pattern pattern = Pattern.compile("fun"); Matcher matcher = pattern.matcher("Java is fun"); // using Matcher find(), group(), start() and end() methods while (matcher.find()) { System.out.println("Found the text \"" + matcher.group() + "\" starting at " + matcher.start() + " index and ending at index ... Read More
The column-span property is used to specify the span between columns. You can try to run the following code to implement column-span property using CSS −Example Live Demo .multi { /* Column count property */ -webkit-column-count: 4; -moz-column-count: 4; column-count: 4; /* Column gap property */ -webkit-column-gap: 40px; -moz-column-gap: 40px; column-gap: 40px; /* Column style property */ column-rule-style: solid; column-rule-color: #ff00ff; ... Read More
The multi-column rule-color property is used to specify the column rule color. You can try to run the following code to implement a rule-color property in CSS3 −ExampleLive Demo .multi { /* Column count property */ -webkit-column-count: 4; -moz-column-count: 4; column-count: 4; /* Column gap property */ -webkit-column-gap: ... Read More
The multi-column column-gap property is used to decide the gap between the columns.ExampleYou can try to run the following code to implement column-gap propertyLive Demo .multi { /* Column count property */ -webkit-column-count: 4; -moz-column-count: 4; column-count: 4; /* Column gap property */ -webkit-column-gap: 40px; ... Read More
The multi-column column-rule property is used to specify the number of rules.You can try to run the following code to implement the column-rule property in CSS3 −ExampleLive Demo .multi { /* Column count property */ -webkit-column-count: 4; -moz-column-count: 4; column-count: 4; /* Column gap property */ -webkit-column-gap: 40px; ... Read More
The following example shows height, width, color, name, and duration of animation with keyframes syntax −ExampleLive Demo h1 { -moz-animation-duration: 3s; -webkit-animation-duration: 3s; -moz-animation-name: slidein; -webkit-animation-name: slidein; } @-moz-keyframes slidein { from { margin-left:100%; width:300% } to { margin-left:0%; width:100%; } } @-webkit-keyframes slidein { from { margin-left:100%; width:300% } to { margin-left:0%; width:100%; } } Tutorials Point this is an example of moving left animation . Reload page function myFunction() { location.reload(); }
Let us learn how to rotate the element based on an angleExampleLive Demo div { width: 300px; height: 100px; background-color: pink; border: 1px solid black; } div#myDiv { /* IE 9 */ -ms-transform: rotate(20deg); /* Safari */ -webkit-transform: rotate(20deg); /* Standard syntax */ transform: rotate(20deg); } Tutorials point.com. Tutorials point.com Output
Use the scaleY() method to change the height of the element with CSS.Let us see the syntax −scaleY(n);Here, n is a number representing the scaling factor.Let us see an example −div { width: 40px; height: 50px; background-color: black; } .myScaled { transform: scaleY(0.9); background-color: orange; }