1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [/a (ASCII-only)](<https://delaparra-services.nl/knowledge-hub/a-ascii-only>)

  

Category: Regex flags 

# /a (ASCII-only)

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## What is /a (ASCII-only)?

 

/a (ASCII-only): Restricts \\w, \\b, \\s, \\d (and case-insensitive matching) to ASCII characters only, instead of full Unicode. The ASCII flag limits shorthand classes such as ` \w `, ` \d `, ` \s ` and ` \b ` to plain ASCII characters. In Python it is ` re.ASCII ` or ` (?a) `. Without it, Python 3 treats letters like é, ß and Chinese characters as word characters too.

 

Definition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)

 

## Frequently asked questions about /a (ASCII-only)

  

### How is /a (ASCII-only) used in practice?

 

That difference matters when you validate input. A pattern like ` ^\w+$ ` for a username will accept ` José ` by default, and reject it with the ASCII flag. Neither is wrong, but you should choose on purpose.

    

### What should you keep in mind with /a (ASCII-only)?

 

For identifiers that end up in URLs, file names or older systems, ASCII-only rules avoid surprises further down the line. For names, addresses and any text written by people, full Unicode is usually what you want. Whatever you pick, test with a few accented and non-Latin examples, not just the English words you used while writing the pattern.

 

## At a glance

   CategoryRegex flags Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More Regex flags terms

 

- [/A (Anchored)](<https://delaparra-services.nl/knowledge-hub/a-anchored>) 
- [/D (Dollar End Only)](<https://delaparra-services.nl/knowledge-hub/d-dollar-end-only>) 
- [/d (hasIndices)](<https://delaparra-services.nl/knowledge-hub/d-hasindices>) 
- [/e (Eval (deprecated))](<https://delaparra-services.nl/knowledge-hub/e-eval-deprecated>) 
- [/g (Global)](<https://delaparra-services.nl/knowledge-hub/g-global>) 
- [/I (Case-Insensitive (POSIX / grep))](<https://delaparra-services.nl/knowledge-hub/i-case-insensitive-posix-grep>)

 

[All terms starting with a number or symbol](<https://delaparra-services.nl/knowledge-hub#letter-other>)

 

## Skills

 

- ### Regex flags across languages

 

Use when writing, porting or debugging a regular expression and its flags/modifiers across languages and tools - JavaScript (g i m s u v y d), PCRE/PHP (i m s x u A D U J), Python re (re.I, re.M, re.S, re.X, re.A), .NET (RegexOptions), POSIX grep/sed. Also use for Laravel \`regex:\` validation rules and for catastrophic backtracking risks.

 [View skill](<https://delaparra-services.nl/skills/regex-flags-cross-language>) [Download zip](<https://delaparra-services.nl/skills/regex-flags-cross-language/download>) 
- ### Regex builder

 

Use when the user asks to create, debug, explain, validate, or optimize a regular expression or replacement for a specific engine. Verifies representative matches, non-matches, captures, escaping, portability limits, and backtracking risk in the target runtime.

 [View skill](<https://delaparra-services.nl/skills/regex-builder>) [Download zip](<https://delaparra-services.nl/skills/regex-builder/download>)

 [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/a-ascii-only/skills.zip>)

 

## Manuals

 

- [Regex for beginners](<https://delaparra-services.nl/manuals/regex-voor-beginners>) 
- [Installing Visual Studio Code](<https://delaparra-services.nl/manuals/visual-studio-code-installeren>)

 

## Related services

 

- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)

Perhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet.

 

## Need any help?

 

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/a-ascii-only)
