English 中文(简体)
JavaScript RegExp Tutorial

Selected Reading

JavaScript RegExp - xnn
  • 时间:2024-11-03

JavaScript RegExp - xnn


Previous Page Next Page  

Description

xnn matches the Latin character specified by the hexadecimal number nn; for example, x0A is the same as .

Example

Following example shows usage of RegExp expression.


<html>
   <head>
      <title>JavaScript RegExp</title>
   </head>
   
   <body>
      <script type = "text/javascript">
		 var str = "abx0Ac";
         var pattern = /x0A/g;

         var index = str.search(pattern);
         document.write("Test 1 - returned value : " +  index); 

         str = "abc";
         index = str.search(pattern);
         document.write("<br/>Test 2 - returned value : " +  index); 	 		 
      </script>
   </body>
</html>

Output


Test 1 - returned value : 2
Test 2 - returned value : -1
Advertisements