Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm currently creating directories with a variable called currentDate.
I am trying to create the following directory:
business/bookings/15/06/2020 //3 levels down. the date is a level.
with business/bookings/currentDate
However, JavaScript and Firebase will interpret the '/' as another directory.
How could I solve this problem given that I'll get a variable that's always formatted this way?
A very simple substitution would be with escape/unescape, but nowadays I'd probably use encodeURIComponent/decodeURIComponent:
encodeURIComponent("business/bookings/currentDate")
"business%2Fbookings%2FcurrentDate"
decodeURIComponent("business%2Fbookings%2FcurrentDate")
"business/bookings/currentDate"
Short version: you can't.
The / character is not admitted in file (and directories) name. What you can do is to substitute the slash character with something else.
Hope this helps.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 12 hours ago.
Improve this question
I want to use value trim() but when I use it, the value part doesn't turn blue it just stay white. How to get the data on value. Please check picture. [value trim] I;(https://i.stack.imgur.com/QTDGB.png) I'm trying to validate the form.
I found out the reason I was using the wrong program. You suppose to use visual studio code. I was using Microsoft visual studio.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 months ago.
Improve this question
Having a hard time with Regex.
What would be the regex for finding a file name with variable in between them?
For eg:
File name : DON_2010_JOE_1222022.txt
In the above file name the words DON, JOE and the format .txt will remain constant. Rest numbers might change for every file. There could be characters as well instead of numbers in those two places.
What im looking for is basically something like DON_*_JOE_*.txt with * being whatever it could be.
Can someone please help me with this?
I tried DON_*_JOE_*.txt and obviously it did not work.
DON_(?<firstString>.*)_JOE_(?<secondString>.*).txt
You can use this. To access the specific group, you can use matcher.group("firstString").
In JavaScript:
"DON_2010_JOE_1222022.txt".match(/DON_.+_JOE_.+\.txt/)
whatever it could be
It is .+ except new lines.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I tried this : [fl]ady?[ing] ?[rb]ug!?
I know [fl]ad[y]?(ing)? ?[br]ug!? is an answer
Can this be solved using character sets only? Must match both.
ladybug
fading rug!
I believe this should work for you
[fl]ad(y|ing)\s?[br]ug?
Check out http://www.regexpal.com/
Using character sets only? So, it doesn't matter what other letter combinations it matches as well? Mmm. Then
[fl]ad[giny]+[\sbrug!]+
would do. See: https://regex101.com/r/FJWJyM/1
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Looking through some open source javascript library and I've come across some single character methods a few times:
myVar.c('foo').t('bar');
myVar refers to an XML DOM element. So what are c() and t()? I don't see any reference to such methods in the API: http://www.w3schools.com/dom/dom_element.asp
There is one remote possibility. When javascript is minified single letters are used to reduce function names. Your example above may be a minified version [file].min.js and therefore function names are obfuscated.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to create a server where if I pressed "w", a variable (lets say me1) would equal to 1. And if another user (from a different browser and IP) pressed the same key, another variable (lets say other2) would equal to 1.
I don't need everything to be JavaScript (as long as it's easy to understand), I just need the end variables to be JavaScript.
Do your users from different IP's need to be able to talk to each other?
You could use NodeJS as one way to do this. I only recommend Node because its very simple to setup sockets if your answer to my above question is yes.
However both technologies would require a medium to advanced skill set.