Q1021. What is the difference between a regular expression and a string?
While both deal with textual data, a **regular expression (RegExp)** and a **string** serve fundamentally different purposes in computer science: | Feature | String | Reg...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (1,100 available).
While both deal with textual data, a **regular expression (RegExp)** and a **string** serve fundamentally different purposes in computer science: | Feature | String | Reg...
The syntax for creating a regular expression pattern consists of a combination of characters, special characters, and operators that define the pattern to match. ``` // D...
A character class in regular expressions is a set of characters that can be matched in a single position in the text. It is denoted by enclosing the characters in square ...
In regular expressions, the asterisk (\*) matches zero or more occurrences of the preceding character, while the plus sign (+) matches one or more occurrences of the prec...
The question mark (?) is a metacharacter used in regular expressions to indicate that the preceding character or group of characters is optional. It means that the preced...
Backslashes () are used in regular expressions to indicate that the following character has a special meaning. For example, the regular expression "\d" matches any digit ...
In a character class, you can specify a range of characters by using a hyphen (-) between two characters. For example, the regular expression "[a-z]" matches any lowercas...
In regular expressions, a greedy match will match as much as possible while still allowing the overall pattern to match. A non-greedy match, on the other hand, will match...
The pipe (|) operator is used in regular expressions to match either one pattern or another. For example, the regular expression "cat|dog" will match either "cat" or "dog...
In regular expressions, the caret (`^`) and dollar sign (`$`) are known as **anchor characters**. They do not match any actual characters; instead, they assert positions ...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.