The Coding Studio Inc. Tips

Using Zero-Width Assertions in Regular Expressions


Anchors ^ $  A  Anchors in regular expressions allow you to specify the context in a string where your pattern should be matched. There are several types of anchors: ^ matches the start of a line (in multiline mode) or the start of the string (by default). $ matches the end of a line (in multiline mode) or the end of the string (by default). A matches the start of the string.  or z matches the end of the string.  matches a word boundary (before the first letter of a word or after the last letter of a word). B matches a position that is not a word boundary (between two letters or between two non-letter characters). These anchors are supported in Java, PHP, Python, Ruby, C#, and Go. In JavaScript, A and  are not supported, but you can use ^ and $ instead of them; just remember to keep the multiline mode disabled. 

Read More

A quote within 24 hours

Contact Us