从长字符串中提取java脚本中以“(/”开头,以“/)结尾”的特定字符串(extract a specific string which start with “(/ ” and ends with “/)” in java script from a long string)
使用长字符串中的javascript提取以“(/”开头,以“/)结尾”的特定字符串。 我试过正规表达没有运气
我的字符串如下
“亲爱的Mr.Ms。(/姓名/),继续担任(/ Developer /)的职位,我想询问您的招聘决定的进展情况以及我的求职申请状况。我非常感谢渴望(/工作/)与贵公司合作。感谢您的时间和考虑,我期待很快收到您的回复。真诚的,(/ YourName /)“
期望的输出=姓名,开发人员,工作,你的名字
Extract a specific string which starts with "(/ " and ends with "/)" using javascript from a long string. I tried regular expression no luck
My string as follows
"Dear Mr./Ms. (/Name/),Following up for the position of (/Developer/), I’d like to inquire about the progress of your hiring decision and the status of my job application. I am very eager to (/Work/) with your company.Thanks for your time and consideration, and I look forward to hear back from you soon.Sincerely,(/YourName/)"
Desired output = Name,Developer,Work,YourName
原文:https://stackoverflow.com/questions/46079384
最满意答案
这里有很多问题。
1 - 使用fx:root允许您自定义FXMLLoader,您可以更改实例组件的方式: 如何使用不同的fxml文件创建多个javafx控制器?
但是,使用SceneBuilder 2它根本不能正常工作! 使用Scene Builder 2的“canonic”方式(与1一起正常工作)似乎不使用fx:root。
2 - 它取决于您在1中选择的模式。可以是FXML中的自定义Java组件,具有显式导入或使用fxml:include。 FXML首先是控制器。 或抽象组件(和控制器为fx:root)然后FXML。
3 - SceneBuilder 2对类加载器有很多麻烦,因为每个自定义组件都加载了一个不同的类加载器,这意味着你将运行很多类似于异常的类。 修复它的一种方法是将SceneBuilder派生用来强制它只为所有自定义组件使用一个类加载器: Scenebuilder 2.0中的自定义组件
或者等待修复。 或者不使用fx:root并且更喜欢fx:include。 或者根本不使用Scene Builder,这是许多有效的解决方案。
Many questions here.
1 - Using fx:root allows you to customize FXMLLoader, you can change the way you instanciate components: How to create multiple javafx controllers with different fxml files?
But, with SceneBuilder 2 it does not work well at all! The "canonic" way with Scene Builder 2 (worked fine with 1) seems to NOT use fx:root.
2 - It depends on your pattern chosen in 1. Could be a custom java component in FXML with an explicit import, or using fxml:include. Either FXML first then controller. Or abstract component (and controller as fx:root) then FXML.
3 - SceneBuilder 2 has many troubles with classloaders as each custom component is loaded with a distinct class loader which means you'll run a lot with class not found like exceptions. One way to fix it is to fork SceneBuilder to force it using only one classloader for all custom components: Custom Components in Scenebuilder 2.0
Or wait for a fix. Or not using fx:root and prefering fx:include. Or not using Scene Builder at all which is for many a valid solution.
相关问答
更多-
IntelliJ内置的Scene Builder 是不一样的 使用 Gluon的场景生成器 。 前者是IDE中嵌入的版本,两年前与IntelliJ IDEA 14一起引入 ,但没有几个功能甚至菜单或最近的改进 ,而后者是完整和更新的版本8.1.1,允许您使用可用的最新功能 或者添加自定义控件,就像您已经完成的那样。 如果您检查IntelliJ 帮助 ,他们还建议使用独立版本(尽管它们仍然指向旧的2.0 Oracle版本),但它们并未引用它们嵌入的版本。 如果你想使用自定义控件,这里唯一的选择是Gluon的版 ...
-
我只发现了一种处理这种反向兼容性的方法:构建我自己的场景构建器。 它是官方开源的,所以你可以用bitbucket上的mercurial来检查它。 然后构建它并对其进行修改,将所有自定义组件和依赖项放在同一个类路径中,以用于一个唯一的类加载器。 检查名为FXOMLLoader的类,它是使用类加载器的地方,我的修复是明确地只为所有组件使用一个类加载器,并在我的deps中添加一些库到类路径中以使其工作。 我已经使用了Jar Class Loader库来实现它,并且它运行良好。 这很不好看。 I have only ...
-
使用自定义Realm时,如何在tomcat6中解析类路径?(how is classpath resolved in tomcat6 when using a custom Realm?)[2024-02-12]
Tomcat的shared ClassLoader并不是您想要的:它是用于跨Web应用程序共享库的。 相反,您需要server ClassLoader。 请注意, server ClassLoader的默认设置是common ClassLoader的默认设置,因此您需要将现有设置从common.loader复制到server.loader ,然后将自己的JAR文件添加到其中。 老实说,如果您有一个与您的某个Web应用程序冲突的自定义领域,您应该只修复Web应用程序和/或领域。 Tomcat's shared ... -
如果你想按工作本身将瓶子复制到所有执行者,你可以使用--jars。 否则,你需要复制罐子。 谢谢拉维 You can use --jars if you want to copy the jars to all executors by job itself. Otherwise you need to copy the jars. Thanks Ravi
-
这里有很多问题。 1 - 使用fx:root允许您自定义FXMLLoader,您可以更改实例组件的方式: 如何使用不同的fxml文件创建多个javafx控制器? 但是,使用SceneBuilder 2它根本不能正常工作! 使用Scene Builder 2的“canonic”方式(与1一起正常工作)似乎不使用fx:root。 2 - 它取决于您在1中选择的模式。可以是FXML中的自定义Java组件,具有显式导入或使用fxml:include。 FXML首先是控制器。 或抽象组件(和控制器为fx:root)然 ...
-
让最基本的FXML自定义控件方案在SceneBuilder中工作(Getting most basic FXML custom control scenario to work in SceneBuilder)[2022-04-26]
好吧,看起来我已被互联网上的一些示例误导,这表明您可以通过在“scenebuilder-classpath”中引用文件系统上的各个类文件来导入组件。 我的例子在设计时在Scene Builder中工作,只有当我将我的类绑定到JAR中并将此JAR导入到自定义库文件夹时。 “scenebuilder-classpath元素”似乎与组件发现无关。 OK it looks like I've been misled by some of the samples available on the internet, ... -
只要您没有将控件标记为已sealed ,您就可以从中创建并创建其他使用已编写功能的用户控件。 只要UserControl是继承链的一部分,一切都应该按照您的预期工作。 So long as you have not marked the control as sealed, you can inhrit from it and create other user controls that use the functionality already written. So long as UserContr ...
-
好, 经过一番搜索,我找到了这个页面: http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-drawing/769/How-do-you-increase-the-nonclient-area-to-support-a-border 这帮了很多忙。 但是,我不得不将switch语句中的检查更改为: .... switch (m.Msg) { case WM_NCCALCSIZE: if (m.WParam != IntPtr.Zero ...
-
是否可以在自定义View类中创建另一个控件?(Is it possible to create another control inside custom View class?)[2022-07-08]
创建自定义View类时,可以使布局膨胀。 在自定义View类构造函数中只需调用inflate(context, R.layout.custom_layout, this); 并在custom_layout中放入ProgressBar和ImageView。 执行此操作时,自定义View会扩展相同的View类,该类是custom_layout的根。例如,如果custom_layout的根是LinearLayout,则扩展LinearLayout。 public class CustomClass extends ... -
答案是类加载器委派模型。 ClassLoader文档描述了它。 要解决您的问题,请尝试更换 URLClassLoader driverLoader = new URLClassLoader(classpath, ClassLoader.getSystemClassLoader()); 同 URLClassLoader driverLoader = new URLClassLoader(classpath, null); 这样,您可以确保URLClassLoader不使用应用程序类路径。 The answ ...