Pattern Literal Field in Java with Examples

Maruthi Krishna
Updated on 05-Dec-2023 10:52:51

1K+ Views

Enables literal parsing of the pattern. In this, all the characters including escape sequences and, meta-characters don’t have any special meaning they are treated as literal characters. For example, normally if you search for the regular expression “^This” in the given input text it matches the lines starting with the word "This". Example 1 import java.util.regex.Matcher; import java.util.regex.Pattern; public class LTERAL_Example { public static void main(String[] args) { String input = "This is the first line" + "This is the second line" ... Read More

Pattern Multiline Field in Java with Examples

Maruthi Krishna
Updated on 05-Dec-2023 10:40:19

3K+ Views

Enables multiline mode in general, the ^ and $ meta characters matches the start and end of the given input with the specified characters irrespective of the number of lines in it. Example 1 import java.util.regex.Matcher; import java.util.regex.Pattern; public class MULTILINE_Example { public static void main( String args[] ) { //String regex = "(^This)";//.*t$)"; String input = "2234 This is a sample text" + "1424 This second 2335 line" + "This id third 455 line" ... Read More

Easiest Way to Reverse a String in Java

Maruthi Krishna
Updated on 05-Dec-2023 09:29:13

1K+ Views

Built-in reverse() method The StringBuffer class provides you a method named reverse(). It reverses the contents of the current StringBuffer object and returns the resultant StringBuffer object. It is the easiest way to reverse a Sting using Java. To do so − Instantiate the StringBuffer class by passing the required String as a parameter. Invoke the reverse() method od the created object. Convert it into String again using the toString() method. Example public class Sample { public static void main(String args[]) { String str = new String("Hello how are you"); StringBuffer sb = new ... Read More

Validate Date Formats Like MM-DD-YYYY Using Regex in Java

Maruthi Krishna
Updated on 05-Dec-2023 09:18:50

4K+ Views

The java.util.regex package of java provides various classes to find particular patterns in character sequences. The pattern class of this package is a compiled representation of a regular expression. To match a regular expression with a String this class provides two methods namely − compile() − This method accepts a string representing a regular expression and returns an object of the Pattern object. matcher() − This method accepts a String value and creates a matcher object which matches the given String to the pattern represented by the current pattern object. Following is the regular expression to match date in dd-MM-yyyy format − ^(1[0-2]|0[1-9])/(3[01]|[12][0-9]|0[1-9])/[0-9]{4}$ Therefore, to validate ... Read More

Full Form of EPROM

Praveen Varghese Thomas
Updated on 04-Dec-2023 16:03:52

419 Views

Introduction Erasable Programmable Read-Only Memory (EPROM) is a non-volatile memory chip type that can be modified, deleted, and reconstructed more than once. In the past, embedded systems, microcontrollers, and other electronic devices frequently employed EPROMs to store firmware and other vital system data. Using a network of transistors and capacitors, EPROMs store binary data. The erasability of EPROMs distinguishes them from other varieties of memory chips. The chip must be removed from the gadget and placed in a specialized rubber machine, where it will be subjected to ultraviolet light for the duration of the several-minute-long erasing operation. Working Principle ... Read More

Full Form of FCI

Praveen Varghese Thomas
Updated on 04-Dec-2023 16:02:55

226 Views

Introduction Food Corporation of India (FCI) was founded in 1965 to guarantee an adequate food supply for the nation's expanding population. The FCI is in charge of running a nationwide system of stores and depots where food grains are kept. Through its extensive transportation network, the FCI also plays a significant part in distributing these grains to different regions of the nation. In addition to its primary duties, the FCI also offers a variety of additional services, such as the implementation of welfare programs based on food, the administration of food- related crises, and the advancement of food grain ... Read More

Full Form of FDC

Praveen Varghese Thomas
Updated on 04-Dec-2023 16:02:01

412 Views

Introduction Floppy Disk Controller (FDC) is an electronic device used to manage the reading and writing of data on floppy disks. In the 1980s and 1990s, floppy disks—a type of magnetic storage medium—were frequently used to store data. The floppy disk drive (FDC) and the computer's central processor unit (CPU) are both connected through the FDC. It regulates both the formatting of data on the disk and the data flow between the computer and the disk drive. The FDC gives instructions to the disk drive so that it may spin the disk and place the read-write head where it ... Read More

Full Form of FHR

Praveen Varghese Thomas
Updated on 04-Dec-2023 16:01:11

142 Views

Introduction Foetal heart rate (FHR) is the heart rate of the foetus. With the advent of technology, medical science has advanced significantly, and we can now monitor the process of childbirth with incredible accuracy and attention. Earlier, even the notion of trying to understand what was happening while the foetus developed inside the womb would have been outlandish. But today, not only can we find the gender of the baby with 100% accuracy before birth, but we can also monitor the baby’s development at every stage of the way. Medical check-ups and care during pregnancy is known as prenatal ... Read More

Full Form of FIPB

Praveen Varghese Thomas
Updated on 04-Dec-2023 15:59:42

183 Views

Introduction Foreign Investment Promotion Board (FIPB) was a government body in India responsible for processing foreign direct investment proposals and granting approvals until it was abolished in 2017. The board played a crucial role in regulating and promoting foreign investments in the country and was responsible for approving foreign investments that were not covered under the automatic route. The FIPB reviewed foreign investment proposals and granted approvals based on their potential impact on the economy and national security. Its primary objective was to attract foreign investors to India and to facilitate their entry into the Indian market, while ensuring ... Read More

Full Form of FIR

Praveen Varghese Thomas
Updated on 04-Dec-2023 15:58:18

281 Views

Introduction First Information Report (FIR) is a written document that is prepared by the police in India, Bangladesh, and other countries to record the details of a crime or an offense that has been committed. The FIR is typically filed by the victim or a witness to the crime, and it is considered the first step in the legal process of investigating and prosecuting a crime. The information recorded in the FIR includes the date, time, and location of the crime, the identity of the victim and the accused, and a description of the offense. Purpose of FIR The ... Read More

Advertisements