JavaScript RegExp \b and \B MetacharacterThe regex "\b" shows the available start or end of the character in the input string in JavaScript. The regex "\b" shows the character's unavailable start or end in the JavaScript input string. We can test, search, and match the arability of the required character in the string. SyntaxesJavaScript "\b" regex syntax The syntax is used to show available characters at the start of the string. The syntax shows the available character at the end of the string. JavaScript "\B" regex syntax The syntax shows an unavailable character at the start of the string. The syntax shows the not available character at the end of the string. ExamplesJavaScript "\b" regex ExamplesThe examples show the availability of the character at the start or end of the string. Example1 The example shows the availability of the required character at the start of the string. Output The output shows the required character at the starting position. Example2 The example shows the availability of the required character at the end of the string. Output The output shows the required character at the starting position. Example3 The example tests of the required character are available at the start of the string with the case-sensitive input value. Output The output shows the case-sensitive character of the beginning position. JavaScript "\B" regex ExamplesThe examples show no character availability at the start or end of the string. Example1 The example shows the required character is unavailable at the start of the string. Output The output shows the required character, not at the beginning position. Example2 The example shows the not available required character at the end of the string. We can get the regular expression or required character to search for the end position. Output The output shows the required character, not the ending position. Example3 The example tests are not available for the required character at the start of the string with the case-sensitive input value. The lowercase data does not test the uppercase character of the string. Output The output shows the case-sensitive character of the beginning position. ConclusionThe "\b" and "\B" metacharacter of the regular expression shows the start and end position of the value. |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India