Anchor

2 snippets across 2 stacks - HTML & CSS, Regular Expressions

Also written as \A anchor

HCHTML & CSS

Basic Links

HC · Links & Navigation
Syntax
<a href="url">link text</a>
Example
<a href="/pricing">View Pricing</a>
<a href="https://example.com">Visit Example</a>

Note Always use descriptive link text. Avoid generic phrases like 'click here' as they are unhelpful for screen readers and SEO.

RXRegular Expressions

\A Absolute Start of String (Python)

RX · Anchors & Boundaries
Syntax
\A  matches the very start of the string (ignores multiline)
Example
Py:  re.search(r'\AFirst', 'First line\nSecond line', re.MULTILINE)
     # Matches 'First'
Py:  re.search(r'^Second', 'First line\nSecond line', re.MULTILINE)
     # Also matches (^ respects multiline)
Output
\A always means absolute start, even with re.MULTILINE

Note \A is not available in JavaScript. It is equivalent to ^ when multiline mode is off, but unlike ^, it never changes behavior with the m flag. Use \A in Python when you always mean the beginning of the entire string.

Frequently asked questions

How does HTML & CSS handle anchor?
This task is covered in 2 stacks on this page: HTML & CSS, Regular Expressions. The "Basic Links" snippet in HTML & CSS uses `<a href="url">link text</a>`.
Which code does the HTML & CSS example use?
The "Basic Links" snippet uses `<a href="url">link text</a>`, from the Links & Navigation section of the HTML & CSS cheat sheet.
Which stacks cover "anchor" on this page?
HTML & CSS, Regular Expressions. Together they hold 2 copy-ready snippets for this task.
Is there anything to watch out for?
Yes. For "Basic Links": Always use descriptive link text. Avoid generic phrases like 'click here' as they are unhelpful for screen readers and SEO.