- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 06:23 AM
I am looking for a Regex to use for machine or computer names. Does anyone have one that works?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 06:39 AM
Hi @Beth_S
I had similar requirement and I got away with-
/\b[a-zA-Z0-9_-]+\b/g
Please mark my answer helpful and correct.
Regards,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 06:32 AM
Hi @Beth_S
However, a common pattern that often works for machine or computer names typically includes alphanumeric characters, hyphens, and underscores.
^[a-zA-Z0-9_-]+$
Use above link for testing
Mark it Helpful and Accept Solution!! If this helps you to understand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 06:39 AM
Hi @Beth_S
I had similar requirement and I got away with-
/\b[a-zA-Z0-9_-]+\b/g
Please mark my answer helpful and correct.
Regards,
Amit