Java code generator
Maybe, you would add Java generator? I would be really happy! :smiley:
+1
Sure, that is not impossible, but I won't be able to support all the Java-specific syntax.
Ok, thanks! :)
Java generator would be great. Thx for your work !
I could generate code for Java, but it would be limited to the syntax available for the flavors regex101 supports. Since I don't support the Java flavor, you won't be able to use character class intersections etc. Are you all fine with that?
I don't really understand where is the limitation, but it is better than nothing i guess.
@Opsse: I am unable to support Java, C#, etc right now because I have found no easy way of compiling their respective regex engine into JavaScript, which is the method I have used for the other languages in order to make the website more responsive and not rely on a backend vulnerable to attacks. Does that make sense?
Ok, i get it. For me it isn't a problem.
Would be better than no java support at all.
@firasdib a simple escape of \ would be enough for the most things.
For completeness a simple java code for using a matcher with capturing group 1,
in case you want to add that:
Pattern pattern = Pattern.compile("REGEX HERE");
Matcher matcher = pattern.matcher("STRING TO COMPARE");
if(matcher.matches()){
String group1 = matcher.group(1);
}
Provide that with an escape of the \ literal & an disclaimer for example:
"Please look into the docs for java specific syntax"
That would already be really helpful, because you have the doc-url, the escaped pattern & a basic code right in front of you.
+1 for Java support even is its limited. As for sample code generation you can probably directly map a few modiers to flags in Pattern.compile()
First, you have the best regex development page on the web - and I've tried a lot. I would love to have java code generation - it doesn't have to be compiled - just show the source.
Hope it will be added in short time. Seven months is a lot for thing like this :laughing:
The "Code generator" itself is not really required, because its trivial. Its more because of the escaping which is required to have the regular expression in Java-Code. When you have more complex expressions its quite errorprone and annoying to escape them manually.
So it would be enough to get the expression as "escaped-Java-String".
Duplicate of #54?
Implemented in v2, rejoice! Lets hope I finish the site asap. (So much work)