Giter Site home page Giter Site logo

Comments (1)

seppestas avatar seppestas commented on August 19, 2024 1

This issue tracker is for regexr, a tool to test regexes. This is a general question regarding programming related to regexes. This question might be better suited for one of the stack exchange sites like Stack overflow. Be sure to mention what programming language you want to use.

I suggest closing this issue because it is off-topic.

In an attempt to be of help anyway:

Short answer is no. What you are looking for is verry specific and regexes are generic. Your example is a lot simpler than most regexes, imagine what it would happen for more generic regex like `.*`. It's set of matched result is infinitely large because the string can be infinitely long!

For your example, assuming you are only interested in ASCII and not e.g Unicode, a quick and dirty for loop could do that for you:

E.g (in JS):

const re = /[A-Z]/;
result = '';
for (test = 'A'; test.charCodeAt(0) < 'Z'.charCodeAt(0); test = String.fromCharCode(test.charCodeAt(0) + 1)) {
	match = test.match(re);
	if (match) {
		console.log(match);
		result += match;
	}
}
console.log(result);

This works because each character has it's own numerical code: https://en.wikipedia.org/wiki/ASCII#Printable_characters.

from regexr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.