首页 \ 问答 \ 从长字符串中提取java脚本中以“(/”开头,以“/)结尾”的特定字符串(extract a specific string which start with “(/ ” and ends with “/)” in java script from a long string)

从长字符串中提取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
更新时间:2023-11-17 16:11

最满意答案

这里有很多问题。

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 ...
  • 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)然 ...
  • 好吧,看起来我已被互联网上的一些示例误导,这表明您可以通过在“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类时,可以使布局膨胀。 在自定义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 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)