My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Getting string between two strings in java

Ethan Manzi's photo
Ethan Manzi
·Feb 15, 2018

I am creating a web server, and since I can't use typical backend languages, I created my own. With JUST this code, I can compile it, but since the code is embedded into the HTML file, I need to isolate it. A simple code block would look like

<j%:
  db store "ethan" as $_GET:demo
  print $_GET:demo
:j%>

and I know how to parse the data inside of the beginning ( <j%: ) and end ( :j%> ) elements, since that engine works, I just need to know how to isolate the code inside of that block if it were in a file like this

<j%:
  db store "ethan" as $_GET:demo
  print $_GET:demo
:j%>

<b>OMG BOI</b>

<p>Output: <j$_GET:demo/j> </p>
<p>Again: <j$_GET:demo/j> </p>


<hr>
<h1>GET Form</h1>
<form method="GET" action="index.html">
  <input type="text" name="demo">
  <input type="submit">
</form>

<hr>
<h1>POST Form</h1>
<form method="POST" action="index.html">
  <input type="text" name="demo">
  <input type="submit">
</form>