Java-Lookbehind

Lookbehind Lookbehind is just like Lookahead. They only assert whether immediate portion behind a given input string’s current portion is suitable for a match or not. We can make our own lookbehinds with the lookbehind operator (?<=). Lookbehind Before the Match Examples   Lookbehind with Lookahead   Lookbehind After the Match Examples   Program Program Source … Read more…

Java-Replace Operations

Replace Operations Regular expressions are especially useful to replace text. Here are the available methods : Method Description replaceFirst(String replacement) Replaces the first matching part of the input stringwith replacement. replaceAll(String replacement) Replaces every matching part of the input string with replacement. The replaceAll( ) method of the Matcher object makes it easy to find … Read more…